STATE_math_get_closest_point_on_segment

 

 


   similar to get_closest_point_on_line()
   only that it returns the closest points among the point on the segment
   in other words if the closest point is not on the segment itself then
   the function will return one of the segment edges (the one which is closest)
  
  		Parameters:
  			[in] P:
  				a point
  
  			[in] A,B: 
  				Two pints that define a segment
  
  			[out] closest_point_on_segment:
  				The a point on the segment defined by A and B that is closest
  				to P. This parameter is calculated by the function (the result)
  
  		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_segment[3];
  		STATE_math_get_closest_point_on_segment(P,A,B,closest_point_on_segment);
  

 

 

Go to page 1      Select API

 

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