utils.pointOnBeam()

The utils.pointOnBeam() function returns true if the point check lies on the endless line that goes through point1 and point2.

Signature

Javascript
bool utils.pointOnBeam(
  Point point1, 
  Point point2, 
  Point check, 
  float precision = 1e6
)

The fourth parameter controls the precision. Lower numbers make the check less precise.

Example

Notes

Typically, you don’t need to worry about precision. But occasionally, you may get unexpected results because of floating point errors, rounding errors, or cubic Bézier juggling.

When that happens, you can lower the precision so you get what you expect.