Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8736593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:20:20+00:00 2026-06-13T10:20:20+00:00

Given: The 3 triangle vertices in a 3D space, the x,y coordinates of a

  • 0

Given: The 3 triangle vertices in a 3D space, the x,y coordinates of a point on that triangle(triangle area included).

Wanted: The z coordinate of the given point.

All 3 triangle vertices have different (x,y) coordinates(they’re heightmap coordinates), so the case of multiple(infinite) matches doesn’t need to be handled.

I’m trying to do this in C, meaning an algorithm operating on simple number types e.g. floats would be best(no matrix or vector operations).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T10:20:21+00:00Added an answer on June 13, 2026 at 10:20 am

    This is done typically with vectors / matrices, which are just shorter notations for the underlying operations.

    • select a reference point from the three vertices O = (ox, oy) = Point1
    • make two vectors U=(ux,uy) = point2 – O; V=(vx,vy) = point3 – O

    • solve the linear system
      x,y = u*U + v*V for u and v

      x = u * (p2x-ox) + v * (p3x-ox)
      y = u * (p2y-oy) + v * (p3y-oy)

    Check that 0 <= u,v <= 1 and 0<=u+v<=1
    If yes, then the point x,y is inside the triangle and
    z = u*(p2z-oz)+v*(p3z-oz)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If you have an equilateral triangle in 3D space, where all the sides are
Let's say I have a triangle given by the three integer vertices (x1,y1), (x2,y2)
Is there a Java graphics library that will rasterize a triangle given the coordinates
I have given the coordinates of 1000 triangles on a plane (triangle number (T0001-T1000)
I am trying to find circumcenter of Given Three point of Triangle…….. NOTE: all
Given that the web application doesn't have su privileges, I'd like to execute a
Given the triangle with vertices (a,b,c): c / \ / \ / \ a
I've been given a struct for a 2D triangle with x and y coordinates,
Given 3 points in a grid, how would you find a point such that
How to draw a triangle using SlimDX's Direct2D interface given triangle vertices are given

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.