+
+
+
Unity Coordinates
+
+ System: X-Right, Y-Up, Z-Forward (Into Screen)
+
+
+ * Pitch direction inverted
+
+
+
+ {/* Controls */}
+
+ handleChange('theta', v)}
+ />
+ handleChange('phi', v)}
+ />
+ handleChange('r', v)}
+ />
+
+
+ {/* Calculations Display */}
+
+
Calculation Logic
+
+
+ {/* Step 1 */}
+
+
// 1. Deg to Rad (Pitch Inverted)
+
θ = {coords.theta}° ⇒ sin: {mathResult.sinT.toFixed(3)}, cos: {mathResult.cosT.toFixed(3)}
+
φ = -({coords.phi})° ⇒ sin: {mathResult.sinP.toFixed(3)}, cos: {mathResult.cosP.toFixed(3)}
+
+
+ {/* Step 2 */}
+
+
// 2. XZ Plane Projection
+
+ r_xz = r * cos(φ)
+
+
+ = {coords.r} * {mathResult.cosP.toFixed(3)} = {mathResult.r_xz.toFixed(3)}
+
+
+
+ {/* Step 3 */}
+
+
// 3. Unity Vectors
+
+ {/* Y */}
+
+ Y (Up) = r * sin(φ)
+
+
+ = {coords.r} * {mathResult.sinP.toFixed(3)} = {mathResult.valY.toFixed(2)}
+
+
+ {/* X */}
+
+ X (Right) = r_xz * sin(θ)
+
+
+ = {mathResult.r_xz.toFixed(3)} * {mathResult.sinT.toFixed(3)} = {mathResult.valX.toFixed(2)}
+
+
+ {/* Z */}
+
+ Z (Fwd) = r_xz * cos(θ)
+
+
+ = {mathResult.r_xz.toFixed(3)} * {mathResult.cosT.toFixed(3)} = {mathResult.valZ.toFixed(2)}
+
+
+
+
+
+ {/* Result Grid */}
+
+
+ X: {mathResult.valX.toFixed(2)}
+
+
+ Y: {mathResult.valY.toFixed(2)}
+
+
+ Z: {mathResult.valZ.toFixed(2)}
+
+
+
+