public class Calc
extends java.lang.Object
| Constructor and Description |
|---|
Calc() |
| Modifier and Type | Method and Description |
|---|---|
static double[] |
angleBetweenTwoLines(Line l1,
Line l2)
Finds angle between the two given lines
|
static double |
distanceBetweenTwoPoints(java.awt.geom.Point2D p1,
java.awt.geom.Point2D p2)
Finds distance between the two provided points
|
static java.awt.geom.Point2D |
intersectionOfLines(Line l1,
Line l2)
Finds a point where the two given lines intersect
|
static Line |
lineThroughTwoPoints(java.awt.geom.Point2D p1,
java.awt.geom.Point2D p2)
Finds a line which goes through provided two points
|
static Line |
parallelLineThroughPoint(Line line1,
java.awt.geom.Point2D point)
Finds a line parallel to the given line containing the given point
|
static Line |
perpendicularLineIntersectingOnPoint(Line l1,
java.awt.geom.Point2D p)
Finds a line which is perpendicular to the the given line and contains it point p
|
static java.awt.geom.Point2D |
symmetricPoint(java.awt.geom.Point2D p1,
Line line)
Finds a point symmetric to the given point with the axis being the provided line
|
static double |
triangleAngle(double a,
double b,
double c)
Finds an angle of the triangle in its apex c, given lengths of its sides
|
static java.awt.geom.Point2D |
triangleCentroid(java.awt.geom.Point2D a,
java.awt.geom.Point2D b,
java.awt.geom.Point2D c)
Finds centroid of the given triangle, given positions of its apices
|
static java.awt.geom.Point2D |
triangleCentroid(Triangle t)
Finds centroid of the triangle, given the whole triangle object
|
public static Line lineThroughTwoPoints(java.awt.geom.Point2D p1, java.awt.geom.Point2D p2)
p1 - The first pointp2 - The second Pointp1 and p2public static Line perpendicularLineIntersectingOnPoint(Line l1, java.awt.geom.Point2D p)
l1 - Linep - Point where the lines intersectl1 containing ppublic static java.awt.geom.Point2D intersectionOfLines(Line l1, Line l2)
l1 - The first linel2 - The second linel1 and l2 intersectpublic static double[] angleBetweenTwoLines(Line l1, Line l2)
l1 - The first linel2 - The second linel1 and l2public static double distanceBetweenTwoPoints(java.awt.geom.Point2D p1,
java.awt.geom.Point2D p2)
p1 - The first pointp2 - The second pointp1 and p2public static double triangleAngle(double a,
double b,
double c)
a - Length of triangle's side ab - Length of triangle's side bc - Length of triangle's side vpublic static java.awt.geom.Point2D triangleCentroid(java.awt.geom.Point2D a,
java.awt.geom.Point2D b,
java.awt.geom.Point2D c)
a - The first triangle apexb - The second triangle apexc - Third triangle apexpublic static java.awt.geom.Point2D triangleCentroid(Triangle t)
t - Triangletpublic static Line parallelLineThroughPoint(Line line1, java.awt.geom.Point2D point)
line1 - Line to which the new line should be parallelpoint - Point the parallel line should containline1 containing pointpublic static java.awt.geom.Point2D symmetricPoint(java.awt.geom.Point2D p1,
Line line)
p1 - Point to which the resulting one should be symmetricline - Line serving as an axis of the symmetryp1 with the axis being line