Package com.google.common.geometry
Class S2Point
- java.lang.Object
-
- com.google.common.geometry.S2Point
-
- All Implemented Interfaces:
Comparable<S2Point>
public class S2Point extends Object implements Comparable<S2Point>
An S2Point represents a point on the unit sphere as a 3D vector. Usually points are normalized to be unit length, but some methods do not require this.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static S2Pointadd(S2Point p1, S2Point p2)doubleangle(S2Point va)Return the angle between two vectors in radiansintcompareTo(S2Point other)static S2PointcrossProd(S2Point p1, S2Point p2)static S2Pointdiv(S2Point p, double m)doubledotProd(S2Point that)booleanequals(Object that)static S2Pointfabs(S2Point p)doubleget(int axis)inthashCode()Calcualates hashcode based on stored coordinates.intlargestAbsComponent()Return the index of the largest component fabsbooleanlessThan(S2Point vb)static S2Pointminus(S2Point p1, S2Point p2)static S2Pointmul(S2Point p, double m)static S2Pointneg(S2Point p)doublenorm()doublenorm2()static S2Pointnormalize(S2Point p)S2Pointortho()return a vector orthogonal to this onestatic S2Pointsub(S2Point p1, S2Point p2)StringtoDegreesString()StringtoString()
-
-
-
Method Detail
-
norm2
public double norm2()
-
norm
public double norm()
-
dotProd
public double dotProd(S2Point that)
-
ortho
public S2Point ortho()
return a vector orthogonal to this one
-
largestAbsComponent
public int largestAbsComponent()
Return the index of the largest component fabs
-
get
public double get(int axis)
-
angle
public double angle(S2Point va)
Return the angle between two vectors in radians
-
lessThan
public boolean lessThan(S2Point vb)
-
compareTo
public int compareTo(S2Point other)
- Specified by:
compareToin interfaceComparable<S2Point>
-
toDegreesString
public String toDegreesString()
-
-