Need your opinion about basic commands (code)

Can anyone help me about how could i write a short code whitch calculating the
POSITION of two points in a plane and the TILT of the line of those two points
Finally I want to calculate the distance between these two points
Basically give me your efforts about math functions or something else I might need
Thanks

I am thinking to use a math function print_line & print_length
Last edited on
I don't understand the first part about calculating the position of two points. A point defines
a position already.

Slope of line: you should recall from your basic algebra that
m = ( y2 - y1 ) / ( x2 - x1 ).

Distance between two points. You should recall again from basic algebra that
d = sqrt( ( x2-x1 )^2 + (y2-y1)^2 )

HINT: ^ is the XOR operator, not a power in C++.

Topic archived. No new replies allowed.