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.

enter image description here

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

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

javascript - addthis share facebook and google+ url -

ios - Show keyboard with UITextField in the input accessory view -