Circle

public final class Circle

Constructors

Link copied to clipboard
public Circle Circle(Float radius, MutablePosition center)
public Circle Circle(Integer radius, MutablePosition center)
public Circle Circle(Double radius, MutablePosition center)

Properties

Link copied to clipboard
private final MutablePosition center
Link copied to clipboard
private final Double circumference

Calculates the circle circumference.

Link copied to clipboard
public final static Float DEGREE_SPIN

The value of the angle (degrees) of a circle spin.

Link copied to clipboard
private final Double diameter

Calculates the circle diameter.

Link copied to clipboard
public final static Double RADIAN_SPIN

The value of the angle (radians) of a circle spin.

Link copied to clipboard
private Double radius

Getter and setter for the circle radius.

Functions

Link copied to clipboard
public final Double angleTo(ImmutablePosition position)

Calculates the angle formed from the given position and the circle center.

public final Double angleTo(Float x, Float y)

Calculates the angle formed from the circle center and the given coordinates.

Link copied to clipboard
public final Float distanceTo(ImmutablePosition position)

Calculates the distance between the circle center and the given position.

public final Float distanceTo(Float x, Float y)

Calculates the distance between the circle center and the given coordinates.

Link copied to clipboard
public final static Circle fromImmutableCenter(Double radius, ImmutablePosition center)

Instance a new circle with a immutable center position.

Link copied to clipboard
public final MutablePosition getCenter()
Link copied to clipboard
public final Double getCircumference()
Link copied to clipboard
public final Double getDiameter()
Link copied to clipboard
public final Double getRadius()

Getter and setter for the circle radius.

Link copied to clipboard

Calculates the circle parametric position for given angle

Link copied to clipboard
@IntRange(from = 1, to = 4)
public final Integer quadrantOf(ImmutablePosition position)
@IntRange(from = 1, to = 4)
public final Integer quadrantOf(ImmutablePosition position, Boolean useMiddle)

Gets the quadrant of the given position.

public final Integer quadrantOf(ImmutablePosition position, Plane.MaxQuadrants maxQuadrants)
public final Integer quadrantOf(ImmutablePosition position, Plane.MaxQuadrants maxQuadrants, Boolean useMiddle)

Gets the quadrant of the given position according the circle center.

Link copied to clipboard
public final Unit setCenter(ImmutablePosition position)
public final Unit setCenter(Float x, Float y)
Link copied to clipboard
public final Unit setRadius(Double radius)