|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectome.util.math.geom2D.PlanePoint
public class PlanePoint
Represents a point in the Euclidean space R2.
Because this space is built on the vector space R2, any instance of this class also represents a vector in R2. Moreover, unless otherwise stated, we assume the orthonormal frame {O, e1, e2} where O=(0,0), e1=(1, 0), e2=(0, 1).
Field Summary | |
---|---|
double |
x1
The first element. |
double |
x2
The second element. |
Constructor Summary | |
---|---|
PlanePoint(double x1,
double x2)
Creates a new instance. |
Method Summary | |
---|---|
double |
angle(PlanePoint vec)
Calculates the angle between this vector and the specified argument, provided none of these vectors is the null vector. |
PlanePoint |
diff(PlanePoint vec)
Calculates the sum of this vector with the reciprocal of the specified argument. |
double |
distance(PlanePoint p)
Calculates the distance between this point and the specified argument. |
double |
dot(PlanePoint vec)
Calulates the dot product of this vector by the specified argument. |
boolean |
equals(double x1,
double x2)
Check to see if the point values are equal. |
boolean |
equals(Object o)
Overridden to reflect equality of abstract values (data object) as opposite to object identity. |
int |
hashCode()
Overridden to reflect equality of abstract values (data object) as opposite to object identity. |
double |
norm()
Calculates the Euclidian norm of this vector. |
PlanePoint |
normalize()
Calculates the unit vector of this vector, provided this is not the null vector. |
PlanePoint |
scalar(double k)
Multiplies this vector by the specified scalar. |
PlanePoint |
sum(PlanePoint vec)
Calculates the sum of this vector with the specified argument. |
PlanePoint |
vec(double x1,
double x2)
Calculates the vector associated to this point and the specified argument. |
PlanePoint |
vec(PlanePoint p)
Calculates the vector associated to this point and the specified argument. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final double x1
public final double x2
Constructor Detail |
---|
public PlanePoint(double x1, double x2)
x1
- The first element.x2
- The second element.Method Detail |
---|
public double distance(PlanePoint p)
p
- The other point. Mustn't be null
.
public PlanePoint sum(PlanePoint vec)
vec
- The other vector. Mustn't be a null
reference.
vec
.public PlanePoint diff(PlanePoint vec)
vec
- The other vector. Mustn't be a null
reference.
-vec
.public PlanePoint scalar(double k)
k
- The scalar.
k
.public PlanePoint vec(PlanePoint p)
f(a, b) = b - a = (b1 - a1, b2 - a2)
p
- The other point. Mustn't be a null
reference.
public PlanePoint vec(double x1, double x2)
f(a, b) = b - a = (b1 - a1, b2 - a2)
p
- The other point. Mustn't be a null
reference.
public double dot(PlanePoint vec)
vec
- The other vector in the product. Mustn't be a
null
reference.
public double norm()
dot
product of this vector by itself.
public PlanePoint normalize()
public double angle(PlanePoint vec)
vec
- The other vector. Mustn't be a null
reference
and mustn't be the null vector.
vec
, in the
range of 0
through pi
.
IllegalArgumentException
- If this vector or vec
or both are the null
vector.public boolean equals(Object o)
equals
in class Object
Object.equals(Object)
public boolean equals(double x1, double x2)
x1
- The comparison point's first element.x2
- The comparison point's second element.
true
if the points are equal, false
otherwise.public int hashCode()
hashCode
in class Object
Object.hashCode()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Version: Beta4.2.1-r8614-Beta4.2-b41
Copyright © 2009 The University of Dundee. All Rights Reserved.