V
- Vector implementation typepublic abstract class AbstractNSphere<V extends EuclideanVector<V>> extends Object implements Region<V>
Modifier | Constructor and Description |
---|---|
protected |
AbstractNSphere(V center,
double radius,
Precision.DoubleEquivalence precision)
Construct a new instance from its component parts.
|
Modifier and Type | Method and Description |
---|---|
RegionLocation |
classify(V pt) |
boolean |
equals(Object obj) |
protected <L extends Embedding<V,Vector1D>> |
firstIntersection(L line,
ToDoubleBiFunction<L,V> abscissaFn,
ToDoubleBiFunction<L,V> distanceFn)
Internal method to compute the first intersection between a line and this instance.
|
V |
getCenter()
Get the center point of the n-sphere.
|
V |
getCentroid() |
Precision.DoubleEquivalence |
getPrecision()
Get the precision object used to perform floating point
comparisons for this instance.
|
double |
getRadius()
Get the radius of the n-sphere.
|
int |
hashCode() |
protected <L extends Embedding<V,Vector1D>> |
intersections(L line,
ToDoubleBiFunction<L,V> abscissaFn,
ToDoubleBiFunction<L,V> distanceFn)
Internal method to compute the intersections between a line and this instance.
|
boolean |
isEmpty() |
boolean |
isFull() |
protected V |
project(V pt,
V defaultVector)
Project the given point to the boundary of the n-sphere.
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
contains, getBoundarySize, project
getSize, isFinite, isInfinite
protected AbstractNSphere(V center, double radius, Precision.DoubleEquivalence precision)
center
- the center point of the n-sphereradius
- the radius of the n-sphereprecision
- precision context used to perform floating point comparisonsIllegalArgumentException
- if center is not finite or radius is not finite or is
less than or equal to zero as evaluated by the given precision contextpublic V getCenter()
public double getRadius()
public Precision.DoubleEquivalence getPrecision()
public boolean isFull()
This method always returns false
.
isFull
in interface Region<V extends EuclideanVector<V>>
public boolean isEmpty()
This method always returns false
.
isEmpty
in interface Region<V extends EuclideanVector<V>>
public V getCentroid()
This method is an alias for getCenter()
.
getCentroid
in interface Region<V extends EuclideanVector<V>>
public RegionLocation classify(V pt)
classify
in interface Region<V extends EuclideanVector<V>>
protected V project(V pt, V defaultVector)
defaultVector
.pt
- the point to projectdefaultVector
- the direction to project the point if it lies
exactly at the center of the n-sphereprotected <L extends Embedding<V,Vector1D>> List<V> intersections(L line, ToDoubleBiFunction<L,V> abscissaFn, ToDoubleBiFunction<L,V> distanceFn)
L
- Line implementation typeline
- line to intersect with the n-sphereabscissaFn
- function used to compute the abscissa value of a point on a linedistanceFn
- function used to compute the smallest distance between a point
and a lineprotected <L extends Embedding<V,Vector1D>> V firstIntersection(L line, ToDoubleBiFunction<L,V> abscissaFn, ToDoubleBiFunction<L,V> distanceFn)
L
- Line implementation typeline
- line to intersect with the n-sphereabscissaFn
- function used to compute the abscissa value of a point on a linedistanceFn
- function used to compute the smallest distance between a point
and a lineCopyright © 2016–2021 The Apache Software Foundation. All rights reserved.