- 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 protectedR2()
-
Method Summary
Modifier and Type Method Description VectorR2add(VectorR2 u, VectorR2 v)VectorR2combine(Double a, VectorR2 u, Double b, VectorR2 v)voiddebug(Output<?> output)Writes a developer readable, debug-formatted string representation of this object tooutput.VectorR2difference(PointR2 p, PointR2 q)TensorDimsdimensions()DoublegetX(VectorR2 v)DoublegetY(VectorR2 v)VectorR2multiply(VectorR2 u, Double a)VectorR2of(Double x, Double y)VectorR2opposite(VectorR2 v)PointR2origin()Rscalar()static R2space()VectorR2subtract(VectorR2 u, VectorR2 v)StringtoString()PointR2translate(PointR2 p, VectorR2 v)R2vector()VectorR2zero()
-
-
-
Method Detail
-
space
public static R2 space()
-
vector
public final R2 vector()
- Specified by:
vectorin interfaceAffineSpace<PointR2,VectorR2,Double>
-
scalar
public final R scalar()
- Specified by:
scalarin interfaceAffineSpace<PointR2,VectorR2,Double>- Specified by:
scalarin interfaceTensorSpace<VectorR2,Double>- Specified by:
scalarin interfaceVectorModule<VectorR2,Double>- Specified by:
scalarin interfaceVectorSpace<VectorR2,Double>
-
dimensions
public TensorDims dimensions()
- Specified by:
dimensionsin interfaceTensorSpace<VectorR2,Double>
-
origin
public final PointR2 origin()
- Specified by:
originin interfaceAffineSpace<PointR2,VectorR2,Double>
-
zero
public final VectorR2 zero()
- Specified by:
zeroin interfaceTensorSpace<VectorR2,Double>- Specified by:
zeroin interfaceVectorModule<VectorR2,Double>- Specified by:
zeroin interfaceVectorSpace<VectorR2,Double>
-
add
public final VectorR2 add(VectorR2 u, VectorR2 v)
- Specified by:
addin interfaceTensorSpace<VectorR2,Double>- Specified by:
addin interfaceVectorModule<VectorR2,Double>- Specified by:
addin interfaceVectorSpace<VectorR2,Double>
-
opposite
public final VectorR2 opposite(VectorR2 v)
- Specified by:
oppositein interfaceTensorSpace<VectorR2,Double>- Specified by:
oppositein interfaceVectorModule<VectorR2,Double>- Specified by:
oppositein interfaceVectorSpace<VectorR2,Double>
-
subtract
public final VectorR2 subtract(VectorR2 u, VectorR2 v)
- Specified by:
subtractin interfaceTensorSpace<VectorR2,Double>- Specified by:
subtractin interfaceVectorModule<VectorR2,Double>- Specified by:
subtractin interfaceVectorSpace<VectorR2,Double>
-
multiply
public final VectorR2 multiply(VectorR2 u, Double a)
- Specified by:
multiplyin interfaceTensorSpace<VectorR2,Double>- Specified by:
multiplyin interfaceVectorModule<VectorR2,Double>- Specified by:
multiplyin interfaceVectorSpace<VectorR2,Double>
-
combine
public final VectorR2 combine(Double a, VectorR2 u, Double b, VectorR2 v)
- Specified by:
combinein interfaceTensorSpace<VectorR2,Double>- Specified by:
combinein interfaceVectorModule<VectorR2,Double>- Specified by:
combinein interfaceVectorSpace<VectorR2,Double>
-
translate
public final PointR2 translate(PointR2 p, VectorR2 v)
- Specified by:
translatein interfaceAffineSpace<PointR2,VectorR2,Double>
-
difference
public final VectorR2 difference(PointR2 p, PointR2 q)
- Specified by:
differencein interfaceAffineSpace<PointR2,VectorR2,Double>
-
debug
public void debug(Output<?> output)
Description copied from interface:DebugWrites a developer readable, debug-formatted string representation of this object tooutput.
-
-