Package org.joml
Class Circlef
- java.lang.Object
-
- org.joml.Circlef
-
- All Implemented Interfaces:
Externalizable,Serializable
public class Circlef extends Object implements Externalizable
Represents a 2D circle using single-precision floating-point numbers.- Author:
- Kai Burjack
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)inthashCode()voidreadExternal(ObjectInput in)StringtoString()Return a string representation of this circle.StringtoString(NumberFormat formatter)Return a string representation of this circle by formatting the vector components with the givenNumberFormat.Circleftranslate(float x, float y)Translatethisby the vector(x, y).Circleftranslate(float x, float y, Circlef dest)Translatethisby the vector(x, y)and store the result indest.Circleftranslate(Vector2fc xy)Translatethisby the given vectorxy.Circleftranslate(Vector2fc xy, Circlef dest)Translatethisby the given vectorxyand store the result indest.voidwriteExternal(ObjectOutput out)
-
-
-
Constructor Detail
-
Circlef
public Circlef()
-
Circlef
public Circlef(Circlef source)
Create a newCirclefas a copy of the givensource.- Parameters:
source- theCirclefto copy from
-
Circlef
public Circlef(float x, float y, float r)- Parameters:
x- the x coordinate of the circle's centery- the y coordinate of the circle's centerr- the radius of the circle
-
-
Method Detail
-
translate
public Circlef translate(Vector2fc xy)
Translatethisby the given vectorxy.- Parameters:
xy- the vector to translate by- Returns:
- this
-
translate
public Circlef translate(Vector2fc xy, Circlef dest)
Translatethisby the given vectorxyand store the result indest.- Parameters:
xy- the vector to translate bydest- will hold the result- Returns:
- dest
-
translate
public Circlef translate(float x, float y)
Translatethisby the vector(x, y).- Parameters:
x- the x coordinate to translate byy- the y coordinate to translate by- Returns:
- this
-
translate
public Circlef translate(float x, float y, Circlef dest)
Translatethisby the vector(x, y)and store the result indest.- Parameters:
x- the x coordinate to translate byy- the y coordinate to translate bydest- will hold the result- Returns:
- dest
-
toString
public String toString()
Return a string representation of this circle.This method creates a new
DecimalFormaton every invocation with the format string "0.000E0;-".
-
toString
public String toString(NumberFormat formatter)
Return a string representation of this circle by formatting the vector components with the givenNumberFormat.- Parameters:
formatter- theNumberFormatused to format the components with- Returns:
- the string representation
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
-