|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectProGAL.geomNd.Point
ProGAL.geom2d.Point
public class Point
A point in (x,y)-space represented using double precision.
Field Summary | |
---|---|
static Point |
origo
|
Constructor Summary | |
---|---|
Point()
Construct a point at (0,0) |
|
Point(double[] coords)
Construct a point with the specified coordinates. |
|
Point(double x,
double y)
Construct a point with the specified coordinates. |
Method Summary | |
---|---|
Point |
add(double a,
double b)
|
Point |
add(Vector v)
Add the vector v to this point and return the result |
Point |
addThis(double a,
double b)
|
Point |
addThis(Point p)
|
Point |
addThis(Vector v)
Add the vector v to this point and return the result (changes this object) |
static double |
area(Point a,
Point b,
Point c)
Returns the signed area of the triangle defined by the three points a, b and c (positive if counterclockwise) |
Point |
clone()
|
static boolean |
collinear(Point a,
Point b,
Point c)
|
boolean |
equals(java.lang.Object o)
Return true iff o is a Point that has the same same coordinates as this. |
boolean |
equals(Point p)
Return true iff p has the same same coordinates as this. |
static Line |
getBisector(Point p,
Point q)
Creates a bisector between points p and q |
double |
getDistance(LineSegment s)
returns distance of this point to segment s |
static double |
getSignedAngle(Point p1,
Point p2,
Point p3)
Returns the angle between the points, but if they make a left turn the angle will be negative. |
double |
getSquaredDistance()
returns squared distance of this point to the origo. |
double |
getSquaredDistance(LineSegment s)
returns squared distance of this point to segment s |
double |
getSquaredDistance(Point q)
returns squared distance of this point to point q. |
static double |
inCircle(Point p,
Point q,
Point r,
Point s)
Returns a positive double if the point is inside the circle through the 3 specified points (must be in clockwise order). |
static boolean |
leftTurn(Point a,
Point b,
Point c)
Returns true if points a, b and c make a left turn at b |
static void |
main(java.lang.String[] args)
|
static Point |
midPoint(Point p,
Point q)
Returns the midpoint of two points. |
double |
polarAngle()
Returns polar angle of this point |
double |
polarAngleCos()
Returns the cosinus of the polar angle of this point |
double |
polarAngleSin()
Returns the sinus of the polar angle of this point |
static boolean |
rightTurn(Point a,
Point b,
Point c)
Returns true if points a, b and c make a right turn at b or are colinear |
void |
rotation(double alpha)
rotates the point around the origo (counterclockwise) |
void |
rotation(double cos,
double sin)
|
void |
rotation(Point p,
double angle)
rotates point p around this point by angle |
Point |
rotationClone(double alpha)
|
Point |
subtract(Vector v)
Subtract the vector v from this point and return the result |
Point |
subtractThis(Point p)
|
Point |
subtractThis(Vector v)
Subtract the vector v from this point and return the result (changes this object) |
void |
toScene(J2DScene scene,
double rad,
java.awt.Color col)
|
Vector |
vectorTo(Point p)
Return a vector pointing from this point to p |
double |
x()
Return the x-coordinate |
double |
y()
Return the y-coordinate |
Methods inherited from class ProGAL.geomNd.Point |
---|
addThis, distance, distance, distanceSquared, distanceSquared, distanceSquaredXY, distanceXY, dot, get, getAngle, getCoord, getCoords, getDimensions, getMidpoint, multiplyThis, polarAngleCosXY, polarAngleSinXY, polarAngleXY, set, set, setCoord, setCoord, toConsole, toConsole, toString, toString, toVector, vectorTo |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static Point origo
Constructor Detail |
---|
public Point()
public Point(double x, double y)
public Point(double[] coords)
Method Detail |
---|
public double x()
public double y()
public Point clone()
clone
in class Point
public Vector vectorTo(Point p)
p
public Point add(Vector v)
v
to this point and return the result
public Point add(double a, double b)
public Point addThis(Vector v)
v
to this point and return the result (changes this object)
public Point addThis(Point p)
public Point addThis(double a, double b)
public Point subtract(Vector v)
v
from this point and return the result
public Point subtractThis(Vector v)
v
from this point and return the result (changes this object)
public Point subtractThis(Point p)
public static double area(Point a, Point b, Point c)
public static boolean collinear(Point a, Point b, Point c)
public double getSquaredDistance()
public double getSquaredDistance(Point q)
public double getSquaredDistance(LineSegment s)
public double getDistance(LineSegment s)
public static double getSignedAngle(Point p1, Point p2, Point p3)
public static double inCircle(Point p, Point q, Point r, Point s)
public double polarAngle()
public double polarAngleSin()
public double polarAngleCos()
public static boolean leftTurn(Point a, Point b, Point c)
public static boolean rightTurn(Point a, Point b, Point c)
public static Point midPoint(Point p, Point q)
public static Line getBisector(Point p, Point q)
public boolean equals(java.lang.Object o)
o
is a Point that has the same same coordinates as this.
equals
in class java.lang.Object
public boolean equals(Point p)
p
has the same same coordinates as this.
public void rotation(double alpha)
public Point rotationClone(double alpha)
public void rotation(double cos, double sin)
public void rotation(Point p, double angle)
public void toScene(J2DScene scene, double rad, java.awt.Color col)
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |