GetAngleBetween3Points
#1

Well I Need A Function That Calculates An Angle Between 3 Points
Reply
#2

Could you please Elaborate? Which angle are you talking about? Can you explain with a Picture?
Reply
#3

Reply
#4

acos( (vector a * vector b) / ( vector lenght a * vector lenght b) ) = angle
Reply
#5

could u please explain i know only the basics of trigonometry vectors and so
Reply
#6

By using GetAngleBetweenPoints-function find the angles between point 2 and point 1 as well as point 2 and point 3, then just calculate the difference between those two angles.
Reply
#7

Quote:
Originally Posted by Opah
Посмотреть сообщение
Not sure how that's the angle between 3 points. As far as I derive from the picture, you have Point1 and Point3 and you'd like to calculate Point2. If that's the case, you just have to do this:
pawn Код:
atan((Point1Y - Point3Y) / (Point1X - Point3X))
Reply
#8

Both vectors have their x, y, and z. Let's define the "vector a" by doing "point 1" - "point 2", and define "vector b" by doing "point 3" - "point 2".

For the angle caclulation you have to first calculate (vect_a_x*vect_b_x)+(vect_a_y*vect_b_y)+(vect_a_z* vect_b_z). If this value equals zero, you have obviosly a 90° radius.
If not, you have to divide it by sqrt((vect_a_x*vect_a_x)+(vect_a_y*vect_a_y)+(vect _a_z*vect_a_z)) * sqrt((vect_b_x*vect_b_x)+(vect_b_y*vect_b_y)+(vect _b_z*vect_b_z)). the result should be insterted into acos, and you'll get your result.

Код:
acos(((vect_a_x*vect_b_x)+(vect_a_y*vect_b_y)+(vect_a_z*vect_b_z))/(sqrt((vect_a_x*vect_a_x)+(vect_a_y*vect_a_y)+(vect_a_z*vect_a_z))*sqrt((vect_b_x*vect_b_x)+(vect_b_y*vect_b_y)+(vect_b_z*vect_b_z))))
Reply
#9



I want measure of angle (BВC)
Reply
#10

ok Thanx Now I get it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)