RedCrab Calculator

Position - position on a line 

  • Calculates a position on the line of two points in the coordinate system

  • The result is an object of the class Point, which contains the x and y coordinates of the calculated position

  • As parameters for the individual x / y coordinates of the two points, two objects of the class Point are passed. The pos parameter determines the position to be calculated.

  • A value of pos between 0 and 1 determines a position between the two points. The position 0 is identical to the first point.

  • With a negative value of pos, the calculated position on the straight line is below point 1. If the value is >1, the calculated position is on the straight line above point 2

  • Position (Point(x,y), Point(x,y), pos)

  • The following example calculates the center between the two points

  • The line in the graphic shows the straight line between the points. The circle marks the center point

  • In the following example, 5 positions are calculated on the straight line
External references

Available in RedCrab PLUS


Distance Distance between two points
Grad Gradient of a straight line
Position Position on the line of two points 


  Products RedCrab Calculator RedCRab Manual  
      RedCrab Software - Singapore - Sengkang West Way