Skip to main content

utils.pointOnBeam()

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

Signature

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

A Utils.pointOnBeam() 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.