
commonMain.korlibs.math.geom.Sphere3D.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of korma Show documentation
Show all versions of korma Show documentation
Mathematic library for Multiplatform Kotlin 1.3
The newest version!
package korlibs.math.geom
import korlibs.math.geom.shape.*
import korlibs.memory.pack.*
//inline class Sphere3D private constructor(private val data: Float4) : Shape3D {
data class Sphere3D(override val center: Vector3, val radius: Float) : Shape3D {
//constructor(center: Vector3, radius: Float) : this(Float4(center.x, center.y, center.z, radius))
//override val center: Vector3 get() = Vector3(data.x, data.y, data.z)
//val radius: Float get() = data.w
override val volume: Float get() = ((4f / 3f) * PIF) * (radius * radius * radius)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy