|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.shapelogic.polygon.Calculator2D
public class Calculator2D
Calculator for simple 2D. There are a lot of small calculations connected with 2D that should not be thrown in Point and Line classes, but belong in a utility class. I might move more stuff into this.
Constructor Summary | |
---|---|
Calculator2D()
|
Method Summary | |
---|---|
static CLine |
addLines(CLine line1,
CLine line2)
|
static double |
angleBetweenLines(double firstAngle,
double nextAngle)
|
static double |
crossProduct(IPoint2D inPoint1,
IPoint2D inPoint2)
A sine from the first to the second times the 2 vector lengths Not a real cross product, but the length of the cross product vector |
static byte |
directionBetweenNeighborPoints(IPoint2D startPoint,
IPoint2D endPoint)
|
static byte |
directionDifference(byte direction1,
byte direction2)
Takes to directions between 0 and 7, and gives the direction difference. |
static double |
distanceOfPointToLine(IPoint2D point,
CLine line)
This is signed. |
static double |
dotProduct(IPoint2D inPoint1,
IPoint2D inPoint2)
A cosine to the angle between times the 2 vector lengths. |
static IPoint2D |
hatPoint(IPoint2D inPoint)
Hat is really a vector operator, I consider a Point a vector here. |
static IPoint2D |
intersectionOfLines(CLine line1,
CLine line2)
Very simple turn the 2 line into a line equation: a * x + b * y = c. |
static IPoint2D |
intersectionOfLinesGeometric(CLine activeLine,
CLine projectionLine)
Deprecated. |
static CLine |
inverseLine(CLine line)
|
static boolean |
linesParallel(CLine line1,
CLine line2)
|
static byte |
oppositeDirection(byte direction)
|
static boolean |
pointIsOnLine(IPoint2D point,
CLine line)
|
static CLine |
pointToLine(IPoint2D point)
|
static IPoint2D |
projectionOfPointOnLine(IPoint2D point,
CLine line)
|
static CLine |
scaleLineFromStartPoint(CLine line,
double length)
|
static IPoint2D |
spannedPoint(IPoint2D point1,
IPoint2D point2,
double fraction)
Find a point on a line spanned by 2 other points. |
static IPoint2D |
unitVector(IPoint2D point)
What should I do about integer based points that does not have a. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Calculator2D()
Method Detail |
---|
public static IPoint2D hatPoint(IPoint2D inPoint)
public static double dotProduct(IPoint2D inPoint1, IPoint2D inPoint2)
public static double crossProduct(IPoint2D inPoint1, IPoint2D inPoint2)
public static double distanceOfPointToLine(IPoint2D point, CLine line)
public static CLine scaleLineFromStartPoint(CLine line, double length)
public static CLine pointToLine(IPoint2D point)
public static IPoint2D projectionOfPointOnLine(IPoint2D point, CLine line)
public static CLine inverseLine(CLine line)
public static CLine addLines(CLine line1, CLine line2)
public static IPoint2D unitVector(IPoint2D point)
point
-
public static boolean linesParallel(CLine line1, CLine line2)
@Deprecated public static IPoint2D intersectionOfLinesGeometric(CLine activeLine, CLine projectionLine)
public static IPoint2D intersectionOfLines(CLine line1, CLine line2)
public static boolean pointIsOnLine(IPoint2D point, CLine line)
public static byte directionBetweenNeighborPoints(IPoint2D startPoint, IPoint2D endPoint)
public static byte oppositeDirection(byte direction)
public static byte directionDifference(byte direction1, byte direction2)
public static double angleBetweenLines(double firstAngle, double nextAngle)
public static IPoint2D spannedPoint(IPoint2D point1, IPoint2D point2, double fraction)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |