Skip to main content

Point.shiftTowards()

The Point.shiftTowards() method returns a new Point that is shifted distance (mm) in the direction of the target.

Signature

Point point.shiftTowards(Point target, float distance)

Example

Point A Point B Point C is point A shifted 3.5 cmin the direction of point B

An example of the Point.shiftTowards() method

Notes

If you need to move a point a percentage instead of a specific distance, use Point.shiftFractionTowards() instead.