File tree Expand file tree Collapse file tree
src/main/kotlin/dev/nextftc/control Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,9 +21,9 @@ package dev.nextftc.control
2121/* *
2222 * Holds a state of a kinetic system.
2323 *
24- * @param position the state's position
25- * @param velocity the state's velocity
26- * @param acceleration the state's acceleration
24+ * @property position the state's position
25+ * @property velocity the state's velocity
26+ * @property acceleration the state's acceleration
2727 *
2828 * @author BeepBot99, Zach Harel
2929 */
@@ -59,6 +59,24 @@ data class KineticState @JvmOverloads constructor(
5959 operator fun unaryMinus (): KineticState = KineticState (- position, - velocity, - acceleration)
6060
6161 companion object {
62+ /* *
63+ * A kinetic state with all components set to zero.
64+ */
6265 @JvmField val ZERO = KineticState ()
66+
67+ /* *
68+ * Creates a kinetic state with the given position and zero velocity and acceleration.
69+ */
70+ @JvmStatic fun pos (position : Double ) = KineticState (position= position)
71+
72+ /* *
73+ * Creates a kinetic state with the given velocity and zero position and acceleration.
74+ */
75+ @JvmStatic fun vel (velocity : Double ) = KineticState (velocity= velocity)
76+
77+ /* *
78+ * Creates a kinetic state with the given acceleration and zero position and velocity.
79+ */
80+ @JvmStatic fun accel (acceleration : Double ) = KineticState (acceleration= acceleration)
6381 }
6482}
You can’t perform that action at this time.
0 commit comments