• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

decide the part

  • Thread starter Thread starter Angelo2449
  • Start date Start date

Angelo2449

Guest
Hello everyone,
I am trying to write a code that can decide on which side is a p point compared to point 1 point 2 vector however oriented.
the choice of the part depends on the direction of the carrier then negative to the left and positive to the right.
the p point is defined by a getpoint, point1 and point2 are already known.
Until now I have achieved unstable results, does anyone know more?
Thank you.
 
if the breast of the angle between the p1-p2 line and the p3 point is positive the point is on the left, if negative to the right.
(minusp (sin)then, if it returns:
t = right
nil = left
 
alternatively extract the coordinates of p1, p2 and p, separate them by nth in the individual x and y and then make comparisons between x and y of the points to place in the plane the point.
more complex procedure, but that can also manage a possible angle of 0° (yellow on the straight)
 
Right!
so I can precisely assess whether the point p lies on the point1 point2 vector
Thank you.
 
alternatively extract the coordinates of p1, p2 and p, separate them by nth in the individual x and y and then make comparisons between x and y of the points to place in the plane the point.
more complex procedure, but that can also manage a possible angle of 0° (yellow on the straight)
does not work in case of non-orthogonal line, in order to verify the hillyness you should learn that the angle between p1-p2 and p1-p3 is equal to zero or more.
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
Back
Top