Package org.pathvisio.libgpml.util
Class LinAlg
java.lang.Object
org.pathvisio.libgpml.util.LinAlg
public class LinAlg
extends java.lang.Object
Helper class for rotation calculations.
- Author:
- unknown
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLinAlg.PointPoint, pair of doubles. -
Constructor Summary
Constructors Constructor Description LinAlg() -
Method Summary
Modifier and Type Method Description static doubleangle(LinAlg.Point p1, LinAlg.Point p2)Determines angle between two vectors defined by p1 and p2 Both vectors start at 0.0static doubledirection(LinAlg.Point p1, LinAlg.Point p2)negative: ccw positive: cwstatic doubledistance(LinAlg.Point p1, LinAlg.Point p2)private static doubledot(LinAlg.Point v1, LinAlg.Point v2)static LinAlg.Pointproject(LinAlg.Point p1, LinAlg.Point p2)Projection of p1 on p2: p1.p2 ----- .static LinAlg.Pointproject(LinAlg.Point p, LinAlg.Point q, LinAlg.Point v)Projection of point q on a line through p with direction vector v If p is 0,0, it's the same as the two-argument function with the same name.static LinAlg.Pointrotate(LinAlg.Point p, double angle)static doubletoLineCoordinates(LinAlg.Point start, LinAlg.Point end, LinAlg.Point p)Convert a 2-D point to 1-D line coordinates (relative position on the line, range {0,1})Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
LinAlg
public LinAlg()
-
-
Method Details
-
angle
Determines angle between two vectors defined by p1 and p2 Both vectors start at 0.0- Parameters:
p1- start point of vectorp2- end point of vector- Returns:
- angle in radians
-
direction
negative: ccw positive: cw -
dot
-
project
Projection of point q on a line through p with direction vector v If p is 0,0, it's the same as the two-argument function with the same name. -
toLineCoordinates
Convert a 2-D point to 1-D line coordinates (relative position on the line, range {0,1}) -
project
Projection of p1 on p2: p1.p2 ----- . p2 p2.p2 -
distance
-
rotate
-