algorithm - Finding the Y of a known X of a line segment? -
i'm trying place hero's feet on ground made of line segments.
if know x,y of points a, b, , c , x of hero, how find y of hero feet touch ground (assume x middle of hero , y along bottom)? , have differently if he's standing on point?
thanks.
if a
, b
2 points in coordinate plane points (xa, ya)
, (xb, yb)
respectively - slope of line between them simple geometry - delta y/delta x, or (yb-ya)/(xb-xa)
. general form of line can given y = ya+(yb-ya)/(xb-xa)*(x-xa)
Comments
Post a Comment