Package org.seamcat.model.geometry
Class Vector2D
- java.lang.Object
-
- org.seamcat.model.geometry.Vector2D
-
public class Vector2D extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Vector2D(double x, double y)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Vector2D
add(Vector2D other)
Vector2D
cwNormal()
The normal vector of same size in clock wise direction.double
dotProduct(Vector2D other)
boolean
equals(java.lang.Object obj)
static Vector2D
fromTo(Point2D a, Point2D b)
double
getX()
double
getY()
int
hashCode()
double
length()
Vector2D
scale(double scale)
java.lang.String
toString()
Vector2D
toUnitVector()
-
-
-
Method Detail
-
getX
public double getX()
-
getY
public double getY()
-
toUnitVector
public Vector2D toUnitVector()
-
length
public double length()
-
scale
public Vector2D scale(double scale)
-
dotProduct
public double dotProduct(Vector2D other)
-
cwNormal
public Vector2D cwNormal()
The normal vector of same size in clock wise direction.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
-