Top Description Fields Constructors Methods
org.apache.commons.math3.geometry.enclosing

public Class EnclosingBall<S extends Space, P extends Point<S>>

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Type Parameters
<S>
Space type.
<P>
Point type.
Imports
java.io.Serializable, org.apache.commons.math3.geometry.Point, .Space

This class represents a ball enclosing some points.
Since
3.3
See Also
Space, Point, Encloser

Field Summary

Modifier and TypeField and Description
private final P
center

Center of the ball.

private final double
radius

Radius of the ball.

private static final long
serialVersionUID

Serializable UID.

private final P[]
support

Support points used to define the ball.

Constructor Summary

AccessConstructor and Description
public
EnclosingBall(final P
center of the ball
center
,
final double
radius of the ball
radius
,
final P...
support points used to define the ball
support
)

Simple constructor.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the point is within the ball or at boundary
contains
(final P
point to test
point
)

Check if a point is within the ball or at boundary.

public boolean

Returns:

true if the point is within the ball enlarged by the margin or at boundary
contains
(final P
point to test
point
,
final double
margin to consider
margin
)

Check if a point is within an enlarged ball or at boundary.

public P

Returns:

center of the ball
getCenter
()

Get the center of the ball.

public double

Returns:

radius of the ball (can be negative if the ball is empty)
getRadius
()

Get the radius of the ball.

public P[]

Returns:

support points used to define the ball
getSupport
()

Get the support points used to define the ball.

public int

Returns:

number of support points used to define the ball
getSupportSize
()

Get the number of support points used to define the ball.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

centerback to summary
private final P center

Center of the ball.

radiusback to summary
private final double radius

Radius of the ball.

serialVersionUIDback to summary
private static final long serialVersionUID

Serializable UID.

supportback to summary
private final P[] support

Support points used to define the ball.

Constructor Detail

EnclosingBallback to summary
public EnclosingBall(final P center, final double radius, final P... support)

Simple constructor.

Parameters
center:P

center of the ball

radius:double

radius of the ball

support:P[]

support points used to define the ball

Method Detail

containsback to summary
public boolean contains(final P point)

Check if a point is within the ball or at boundary.

Parameters
point:P

point to test

Returns:boolean

true if the point is within the ball or at boundary

containsback to summary
public boolean contains(final P point, final double margin)

Check if a point is within an enlarged ball or at boundary.

Parameters
point:P

point to test

margin:double

margin to consider

Returns:boolean

true if the point is within the ball enlarged by the margin or at boundary

getCenterback to summary
public P getCenter()

Get the center of the ball.

Returns:P

center of the ball

getRadiusback to summary
public double getRadius()

Get the radius of the ball.

Returns:double

radius of the ball (can be negative if the ball is empty)

getSupportback to summary
public P[] getSupport()

Get the support points used to define the ball.

Returns:P[]

support points used to define the ball

getSupportSizeback to summary
public int getSupportSize()

Get the number of support points used to define the ball.

Returns:int

number of support points used to define the ball