point2line | |

This lightweight Processing/Java library contains basic tools for calculating geometry in two dimensions. It includes a vector class that offers an alternative to the build in PVector class. The library only adds functions that I either miss in the existing collection of libraries or think could be simplified. Vect2 stores and manipulates vectors and positions in 2D. Space2 serves as a toolbox for geometry calculations in 2D. The library does not depend on other libraries and should be able to run on most Processing versions and all OS platforms (please report problems).
RELEASE 06. UPDATED THE JULY 23RD 2013http://sixthsensor.dk/code/p5/point2line/download/point2line.zip Read the revisions.
Carl Emil Carlsen 2008+ |
## Vect2## propertiesxy isZero ( ) isAlmostZero ( ) equals ( ) ## basic mathadd ( )added ( ) subtract ( ) subtracted ( ) scale ( ) scaled ( ) divide ( ) divided ( ) ## magnitudemagnitude ( )setMagnitude ( ) normalize ( ) normalized ( ) clip ( ) clipped ( ) isGreaterThan ( ) isLessThan ( ) squareMagnitude ( ) ## rotationangle ( )rotate ( ) rotated ( ) setRotation ( ) rotateLeft ( ) rotatedLeft ( ) rotateRight ( ) rotatedRight ( ) flip ( ) flipped ( ) rotateAround ( ) rotatedAround ( ) ## helpersset ( )setZero ( ) clone ( ) toString ( ) ## static toolslerp ( )distance ( ) dot ( ) angleBetween ( ) angleBetweenUnits ( ) angleFromTo ( ) midpoint ( ) ## Space2## static toolsellipsePoint ( )insidePolygon ( ) pointToLineDistance ( ) closestPointToLine ( ) closestPointOnLine ( ) closestPointOnLineSegment ( ) lineIntersection ( ) lineSegmentIntersection ( ) |