- java.lang.Object
-
- swim.math.R2
-
- All Implemented Interfaces:
Debug
,AffineSpace<PointR2,VectorR2,Double>
,F2<VectorR2,Double>
,TensorSpace<VectorR2,Double>
,VectorModule<VectorR2,Double>
,VectorSpace<VectorR2,Double>
public class R2 extends Object implements AffineSpace<PointR2,VectorR2,Double>, VectorSpace<VectorR2,Double>, F2<VectorR2,Double>, Debug
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
R2()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description VectorR2
add(VectorR2 u, VectorR2 v)
VectorR2
combine(Double a, VectorR2 u, Double b, VectorR2 v)
void
debug(Output<?> output)
Writes a developer readable, debug-formatted string representation of this object tooutput
.VectorR2
difference(PointR2 p, PointR2 q)
TensorDims
dimensions()
Double
getX(VectorR2 v)
Double
getY(VectorR2 v)
VectorR2
multiply(VectorR2 u, Double a)
VectorR2
of(Double x, Double y)
VectorR2
opposite(VectorR2 v)
PointR2
origin()
R
scalar()
static R2
space()
VectorR2
subtract(VectorR2 u, VectorR2 v)
String
toString()
PointR2
translate(PointR2 p, VectorR2 v)
R2
vector()
VectorR2
zero()
-
-
-
Method Detail
-
vector
public final R2 vector()
- Specified by:
vector
in interfaceAffineSpace<PointR2,VectorR2,Double>
-
scalar
public final R scalar()
- Specified by:
scalar
in interfaceAffineSpace<PointR2,VectorR2,Double>
- Specified by:
scalar
in interfaceTensorSpace<VectorR2,Double>
- Specified by:
scalar
in interfaceVectorModule<VectorR2,Double>
- Specified by:
scalar
in interfaceVectorSpace<VectorR2,Double>
-
dimensions
public TensorDims dimensions()
- Specified by:
dimensions
in interfaceTensorSpace<VectorR2,Double>
-
origin
public final PointR2 origin()
- Specified by:
origin
in interfaceAffineSpace<PointR2,VectorR2,Double>
-
zero
public final VectorR2 zero()
- Specified by:
zero
in interfaceTensorSpace<VectorR2,Double>
- Specified by:
zero
in interfaceVectorModule<VectorR2,Double>
- Specified by:
zero
in interfaceVectorSpace<VectorR2,Double>
-
add
public final VectorR2 add(VectorR2 u, VectorR2 v)
- Specified by:
add
in interfaceTensorSpace<VectorR2,Double>
- Specified by:
add
in interfaceVectorModule<VectorR2,Double>
- Specified by:
add
in interfaceVectorSpace<VectorR2,Double>
-
opposite
public final VectorR2 opposite(VectorR2 v)
- Specified by:
opposite
in interfaceTensorSpace<VectorR2,Double>
- Specified by:
opposite
in interfaceVectorModule<VectorR2,Double>
- Specified by:
opposite
in interfaceVectorSpace<VectorR2,Double>
-
subtract
public final VectorR2 subtract(VectorR2 u, VectorR2 v)
- Specified by:
subtract
in interfaceTensorSpace<VectorR2,Double>
- Specified by:
subtract
in interfaceVectorModule<VectorR2,Double>
- Specified by:
subtract
in interfaceVectorSpace<VectorR2,Double>
-
multiply
public final VectorR2 multiply(VectorR2 u, Double a)
- Specified by:
multiply
in interfaceTensorSpace<VectorR2,Double>
- Specified by:
multiply
in interfaceVectorModule<VectorR2,Double>
- Specified by:
multiply
in interfaceVectorSpace<VectorR2,Double>
-
combine
public final VectorR2 combine(Double a, VectorR2 u, Double b, VectorR2 v)
- Specified by:
combine
in interfaceTensorSpace<VectorR2,Double>
- Specified by:
combine
in interfaceVectorModule<VectorR2,Double>
- Specified by:
combine
in interfaceVectorSpace<VectorR2,Double>
-
translate
public final PointR2 translate(PointR2 p, VectorR2 v)
- Specified by:
translate
in interfaceAffineSpace<PointR2,VectorR2,Double>
-
difference
public final VectorR2 difference(PointR2 p, PointR2 q)
- Specified by:
difference
in interfaceAffineSpace<PointR2,VectorR2,Double>
-
debug
public void debug(Output<?> output)
Description copied from interface:Debug
Writes a developer readable, debug-formatted string representation of this object tooutput
.
-
space
public static R2 space()
-
-