STATE_math_get_closest_point_on_line

 

 


   P is a point
   AB is a line
   The result is returned through closest_point_on_line
  	 closest_point_on_line is the a point on the line defined by A and B that is closest to P
   Returns OK or VR_ERROR (error if point A is equal to point B)
   Example:
  		P[0]=1; P[1]=2; P[2]=30;
  		A[0]=10; A[1]=20; A[2]=30;
  		B[0]=100; B[1]=200; B[2]=300;
  		double  closest_point_on_line[3];
  		STATE_math_get_closest_point_on_line(P,A,B,closest_point_on_line);
  
   See also STATE_math_is_point_on_segment() which can be used to determine whether the point 
   between A and B

 

 

Go to page 1      Select API

 

Copyright © 2007 3DSTATE Corporation. www.3dstate.com