1 पॉइंट द्वारा GN⁺ 2024-06-16 | 1 टिप्पणियां | WhatsApp पर शेयर करें
  • 3D rotations में हर representation की अपनी ताकत होती है: point transformation के लिए rotation matrix सुविधाजनक है, लेकिन interpolation, composition और averaging के लिए अलग tools चाहिए
  • Euler angles इंसानों के लिए संभालना आसान हैं, लेकिन gimbal lock, non-constant angular velocity, और linear interpolation में shortest path छूट जाने जैसी समस्याएँ हो सकती हैं
  • unit quaternion slerp के जरिए constant-speed shortest-path interpolation देता है, लेकिन यह vector space नहीं है, इसलिए direct authoring, scalar multiplication और averaging सहज नहीं लगते
  • exponential/logarithmic maps axis/angle vector और rotation matrix को जोड़ते हैं, जिससे R(t) = exp(t log(R1 R0^-1)) R0 के रूप में 2D और 3D shortest-path interpolation बनाया जा सकता है
  • कई rotations का average सिर्फ axis/angle average से निकालने पर catastrophic cancellation हो सकता है; Karcher mean squared angular distances के sum को minimize करने वाली rotation को iteratively खोजकर ज्यादा consistent परिणाम देता है

rotation representations के फायदे और नुकसान

  • 3D rotations के लिए कई representations हैं, और transformation, authoring, interpolation या averaging—आप क्या करना चाहते हैं—इसके आधार पर सही चुनाव बदलता है
  • rotation matrix

    • सबसे direct linear algebra representation, positive determinant वाली orthonormal 3x3 matrix है
    • rotation matrix के तीन columns बताते हैं कि rotation के बाद x, y, z axes कहाँ जाते हैं
    • point transformation को matrix multiplication से किया जा सकता है, और अन्य linear transformations के साथ भी matrix multiplication से compose किया जा सकता है
    • screen पर draw करते समय rotation matrix इस्तेमाल करने का कारण यह है कि world-space से screen तक points ले जाने के लिए सिर्फ एक matrix multiplication चाहिए होता है
    • rotation matrix vector space नहीं है, इसलिए दो rotation matrices को जोड़ने पर फिर से rotation matrix नहीं मिलती
    • दो rotation matrices को linearly interpolate करने पर rotation के साथ scaling भी मिल सकती है
  • Euler angles

    • Euler angles x, y, z axes के लिए तीन rotations specify करते हैं, और इन्हें pitch, yaw, roll भी कहा जाता है
    • तीन component rotations को लागू करने का order convention के अनुसार बदलता है; उदाहरण में x, y, z order इस्तेमाल होता है
    • इंसानों के लिए समझना आसान है और rotation authoring में अक्सर इस्तेमाल होते हैं, लेकिन simple interpolation अनचाहे परिणाम दे सकता है
    • किसी एक component rotation की वजह से बाकी दो rotation axes parallel हो जाना gimbal lock कहलाता है और यह singularity है
    • singularity पर locked दो angles में से किसी को भी बदलने से वही output rotation बन सकती है
    • अगर interpolation path singularity तक पहुँच जाए, तो current position को represent करने की degrees of freedom बढ़ जाती हैं, और आगे बढ़ने के लिए कोई arbitrary representation चुनने पर output interpolation discontinuous हो सकता है
    • हर component angle cyclic होता है, इसलिए linear interpolation हमेशा दो rotations के बीच shortest path नहीं चुनता
    • अगर path singularity से नहीं गुजरता तो interpolation smooth होता है, और अगर “straight up” और “straight down” represent करने की जरूरत नहीं है तो सीमाओं को workaround किया जा सकता है
  • Quaternions

    • unit quaternion rotation composition और interpolation के standard tool के रूप में इस्तेमाल होता है
    • spherical linear interpolation, यानी slerp, दो quaternions के बीच constant-speed shortest path चुनता है
    • unit quaternion भी vector space नहीं है, इंसानों के लिए direct authoring मुश्किल है, और interpolation में computation cost लग सकती है
    • scalar multiplication या averaging को लेकर भी intuitive concept की कमी है
    • quaternion rotation space को double-cover करता है, इसलिए कुछ स्थितियों में Q(1) -Q1 तक जा सकता है
  • Axis/angle

    • axis/angle rotation को real 3D vector से represent किया जाता है
    • vector की direction rotation axis बताती है, और magnitude उस axis के लिए rotation angle specify करता है
    • इसे θu के रूप में लिखा जाता है; u unit vector है और θ rotation angle है
    • 3D vector होने के कारण यह vector space बनाता है, इसलिए addition, scaling और interpolation संभव हैं
    • दो axis/angle rotations को linearly interpolate करने पर smooth और constant angular velocity मिल सकती है
    • हालांकि target rotation को किस axis/angle representation में specify किया गया है, इस पर निर्भर करते हुए linear interpolation shortest path नहीं चुन सकता
    • quaternion की तरह axis/angle vector भी rotation space को double-cover करता है

exponential map और logarithmic map

  • अगर अलग-अलग rotation representations के बीच जरूरत के अनुसार आ-जा सकें, तो हर representation की खूबियों को साथ में इस्तेमाल किया जा सकता है
  • final transformation के लिए rotation matrix चाहिए, इसलिए matrix को canonical form मानते हैं
  • exponential map वह function है जो rotation object लेकर equivalent rotation matrix लौटाता है
  • logarithmic map वह corresponding function है जो rotation matrix लेकर वापस rotation object देता है
  • यहाँ rotation matrix और axis/angle vector के बीच आने-जाने वाले exp और log maps की बात की गई है

2D axis/angle से शुरू होने वाली intuition

  • 2D में rotation axis केवल एक होता है, जो plane के बाहर की ओर होता है, इसलिए axis/angle rotation को सिर्फ एक angle θ से represent किया जा सकता है
  • 2D point p को θ से rotate किया गया इस तरह लिखा जा सकता है
    • pθ = p cosθ + Jp sinθ
    • J वह matrix है जो 2D vector को 90 degrees rotate करती है
  • J [[0, -1], [1, 0]] है, और J² = -I होने के कारण इसे दो बार apply करने पर 180-degree rotation मिलता है
  • इस expression को expand करने पर standard 2D rotation matrix [[cosθ, -sinθ], [sinθ, cosθ]] मिलती है

2D exponential map और logarithmic map

  • complex numbers के Euler formula e^(iθ) = cosθ + i sinθ में जैसे i quarter turn की भूमिका निभाता है, 2D matrix expression में J वही भूमिका निभाता है
  • exponential function की Taylor series में matrix A = θJ डालने पर matrix addition, multiplication और scaling से वही calculation की जा सकती है
  • expansion के बाद sinθ और cosθ की Taylor series दिखाई देती हैं, और यह expression मिलता है
    • e^(θJ) = [[cosθ, -sinθ], [sinθ, cosθ]]
  • इसलिए 2D exponential map angle θ को corresponding rotation matrix में बदलता है
  • logarithmic map को exponential map के inverse के रूप में define किया जाता है
    • R = exp(θJ) हो तो log(R) = θJ
    • θ = atan2(R21, R11) से restore किया जा सकता है
  • exponential map injective नहीं है
    • exp(θJ) = exp((θ + 2π)J) है, इसलिए एक पूरा turn जोड़ने पर भी वही rotation matrix मिलती है
    • logarithmic map को इस तरह define किया जाता है कि वह उस rotation matrix से corresponding सबसे छोटा angle लौटाए
    • atan2 इस definition को implement करता है

exp/log आधारित interpolation

  • दो 2D rotation angles θ0, θ1 को सीधे linearly interpolate करके rotation matrix बनाई जा सकती है
  • लेकिन अगर θ0 और θ1, π से ज्यादा दूर हैं, तो angles की cyclic प्रकृति reflect नहीं होती और लंबा path चुना जाता है
  • exp/log आधारित interpolation दो rotation matrices R0, R1 से सीधे movement rotation compute करता है
    • R1 R0^-1 वह rotation है जो पहले R0 को undo करता है और फिर R1 apply करता है
    • log(R1 R0^-1) R0 से R1 तक जाने का सबसे छोटा angle देता है
    • इस axis/angle rotation को t से scale करके exp के जरिए फिर matrix में बदलते हैं
  • final interpolation formula यह है
    • R(t) = exp(t log(R1 R0^-1)) R0
    • R(0) = R0, R(1) = R1
  • 2D में angle difference directly check किया जा सकता है, लेकिन यह method बिना बदलाव के 3D और arbitrary dimensions में generalize होता है

3D axis/angle और skew-symmetric matrix

  • 3D में भी axis/angle θu को exponentiate करके rotation matrix बनाई जा सकती है
  • मुख्य बात unit vector u को axis मानकर quarter turn transformation ढूँढना है
  • cross product u × p को u और p से बने plane के perpendicular vector के रूप में define किया जाता है, लेकिन इसे p को u के perpendicular plane पर project किए गए p⊥ के quarter turn के रूप में भी समझा जा सकता है
  • u × p जैसा result देने वाली matrix û बनाई जा सकती है
    • û = [[0, -uz, uy], [uz, 0, -ux], [-uy, ux, 0]]
    • ûp = u × p
  • ûᵀ = -û होने के कारण û skew-symmetric matrix है
  • 2D का J भी skew-symmetric है और 2D cross product को represent करता है, इसलिए वही structure आगे चलता है
  • skew-symmetric matrices का sum और scalar multiplication भी skew-symmetric होता है, इसलिए axis/angle vector space की properties इस matrix representation में भी बनी रहती हैं
  • identity û^(k+2) = -û^k इस geometric interpretation से आती है कि cross product को तीन बार apply करने पर p⊥ के तीन quarter turns होते हैं, जो negative quarter turn के बराबर है

3D exponential map: Rodrigues’ formula

  • axis/angle rotation θu से θû बनाकर उसे exponentiate करने पर 3D rotation matrix मिलती है
  • Taylor series और û^(k+2) = -û^k का इस्तेमाल करने पर यह formula निकलता है
    • e^(θû) = I + sin(θ)û + (1 - cos(θ))û²
  • यह formula Rodrigues’ formula के नाम से जाना जाता है
  • θ = 0 होने पर e^(0û)p = p होता है, यानी point जस का तस रहता है
  • θ = π/2 होने पर u × p + p∥ मिलता है, यानी quarter rotation होता है
  • θ = π होने पर -p⊥ + p∥ मिलता है, यानी half rotation होता है
  • यह matrix orthonormal है
    • AᵀA = I condition को ûᵀ = -û और û^(k+2) = -û^k से verify किया जाता है
  • determinant θ = 0 पर 1 है, determinant कभी 0 नहीं होता, और exp θ और û के लिए continuous है, इसलिए यह negative नहीं हो सकता
  • इसलिए exp(θû) 3D rotation matrix है

3D logarithmic map

  • 3D exponential map भी injective नहीं है, इसलिए 3D logarithmic map को इस तरह define किया जाता है कि वह दी गई matrix के corresponding सबसे छोटे magnitude की axis/angle rotation लौटाए
  • R = exp(θû) = I + sin(θ)û + (1 - cos(θ))û² में trace लेने पर rotation angle मिल सकता है
    • trace diagonal sum है
    • tr(I) = 3
    • û skew-symmetric है, इसलिए diagonal sum 0 है
    • tr(û²) = -2 है
    • इसलिए tr(R) = 1 + 2cosθ
    • θ = arccos((tr(R) - 1) / 2)
  • rotation axis को R को antisymmetrize करके restore किया जाता है
    • R - Rᵀ = 2 sin(θ)û
    • û = (R - Rᵀ) / (2 sinθ)
    • u = 1/(2 sinθ) [R32 - R23, R13 - R31, R21 - R12]ᵀ
  • इस तरह 3D rotation matrix से axis/angle में लौटने वाला पूरा logarithmic map complete होता है

3D interpolation के परिणाम

  • 3D में भी 2D वाला interpolation formula वैसे ही लागू होता है
    • R(t) = exp(t log(R1 R0^-1)) R0
  • यह interpolation axis/angle rotation की खूबियाँ बनाए रखते हुए हमेशा shortest path चुनता है
  • Euler angles से वही example smooth नहीं दिख सकता

कई rotations का average

  • quaternion इस्तेमाल करने पर अच्छा interpolation मिल सकता है, इसलिए exp/log matrix math के बिना भी interpolation problem हल हो सकती है
  • axis/angle rotation से आसान होने वाले कामों में से एक है कई rotation matrices का average
  • सबसे simple तरीका है हर matrix को axis/angle में बदलना, vectors का average निकालना, और फिर वापस convert करना
  • यह method valid है, लेकिन unintuitive behavior पैदा कर सकता है
  • खास तौर पर axis/angle vectors को जोड़ने पर catastrophic cancellation हो सकता है
    • उदाहरण में [π, 0, 0] और [-π, 0, 0] का average लेने पर 0 बन जाता है
    • दोनों values equivalent rotations हैं, लेकिन average result 0 उन दोनों rotations को represent नहीं करता

Karcher mean

  • plane में points का average उन सभी points तक squared distances के कुल योग को minimize करने वाले point के रूप में देखा जा सकता है
  • इसे iterative optimization से खोजने की procedure यह है
    • initial estimate x̄ ∈ R² चुनें
    • हर point से estimate तक की translation ui = xi - x̄ compute करें
    • vector average u = (1/n) Σ ui निकालें
    • x̄ = x̄ + τu से average direction में move करें
    • जब तक |u| > ε हो, repeat करें
  • यही idea rotations R0, ..., Rn पर लागू किया जा सकता है
    • initial estimated rotation R̄ ∈ R^(3×3) चुनें
    • हर matrix के लिए estimate से उस rotation तक का axis/angle ui = log(Ri R̄^-1) compute करें
    • vector average u = (1/n) Σ ui निकालें
    • R̄ = exp(τu) R̄ से average rotation direction में move करें
    • जब तक |u| > ε हो, repeat करें
  • इस algorithm का result Karcher mean है
  • Karcher mean वह rotation है जो बाकी सभी rotations तक squared angular distances को minimize करता है
  • यह catastrophic cancellation से प्रभावित नहीं होता और हमेशा non-zero intermediate rotation पर converge करता है
  • simple axis/angle average और Karcher mean के results अक्सर मिलते-जुलते होते हैं, लेकिन Karcher mean ज्यादा consistent behavior दिखाता है

Quaternion और exp/log का संबंध

  • यह हिस्सा quaternion knowledge मानकर चलता है
  • जैसे complex number exponentiation skew-symmetric 2D matrix exponentiation के equivalent था, वैसे ही quaternion exponentiation skew-symmetric 3D matrix exponentiation के equivalent है
  • 2D में axis/angle rotation θ से pure-imaginary complex number बनाकर exponentiate करते हैं
    • e^(iθ) = cosθ + i sinθ
    • result ऐसा complex number है जो point से multiply करने पर उसे θ से rotate करता है
    • norm हमेशा 1 होता है, इसलिए 2D rotation को unit-norm complex number से represent किया जा सकता है
  • 3D में axis/angle rotation vector u से pure-imaginary quaternion q = ux i + uy j + uz k बनाया जा सकता है
  • quaternion multiplication rules का इस्तेमाल करने पर q² = -||q||² = -θ² बनता है, जो skew-symmetric matrix में इस्तेमाल हुई identity जैसा है
  • exponentiation का result यह है
    • e^q = cosθ + (q/θ) sinθ
    • यह 2D formula से लगभग समान है, लेकिन imaginary axis एक नहीं बल्कि तीन हैं
  • 3D axis/angle rotation unit-norm quaternion में convert होती है
  • अगर rotation matrix की जरूरत नहीं है, तो quaternion exponential map compute करने के लिए आसान option है
  • quaternion logarithmic map भी simple है
    • θ = arccos(Re(q))
    • u = Im(q) / sinθ
  • quaternion q से point p को rotate करने के लिए conjugation q p q^-1 compute करते हैं
    • point को pure-imaginary quaternion के रूप में represent करते हैं, जहाँ p = px i + py j + pz k
    • conjugation तकनीकी रूप से u axis के around से rotate करता है, इसलिए शुरुआत में |u| = θ/2 रखना होता है

आगे पढ़ने के लिए

1 टिप्पणियां

 
GN⁺ 2024-06-16
Hacker News की रायें
  • Lie group/Lie algebra correspondence उन सबसे शानदार concepts में से एक है जो काश स्कूल में पढ़ाया गया होता। यह लेख में बताए गए exponential map और logarithm map जैसा ही है, लेकिन कहीं ज़्यादा reusable रूप में सामने आता है
    अगर 3D rotation जैसी किसी abstract चीज़ को, coordinate की बारीकियों में उलझे बिना, पकड़ें तो वही Lie group है; और उससे अच्छी तरह काम करने वाला coordinate representation निकालें तो संबंधित Lie algebra बनता है
    फिर coordinates और abstract object के बीच आना-जाना, composition करना आदि लगभग मुफ्त में मिल जाते हैं, और engineering में अक्सर मिलने वाले मामलों में interpolation और average भी काफ़ी reasonable तरीके से संभल जाते हैं
    अगर किसी problem को Lie groups के combination के रूप में व्यक्त किया जा सके, तो हर algebra क्या है यह खोजकर, खुद करने पर लंबा लगने वाला बहुत-सा काम बचाया जा सकता है
    यहाँ object में smooth change की अवधारणा और थोड़ी अतिरिक्त structure होनी चाहिए, और आने-जाने की प्रक्रिया में connected components की समस्या भी आ सकती है, लेकिन यही वजह है कि पहले से ज्ञात results उधार लेकर इस्तेमाल करना अच्छा रहता है

  • एक लंबा हफ्ता लगभग खत्म होने को है, और slider से गाय को rotate करना ठीक वही break था जिसकी जरूरत थी

    • ढेर सारे numbers दिखते ही आँखें धुंधली हो गईं, लेकिन गाय सचमुच cute थी
    • इसे low-effort iOS cash cow game बना दिया जाए तो बिल्कुल सही लगेगा
  • लंबे समय से शिकायत रही है कि बहुत-से 3D software rotation के लिए Arcball interface इस्तेमाल नहीं करते
    Autodesk के products 3DSmax और Maya इसे इस्तेमाल करते हैं, लेकिन Blender और OpenSCAD नहीं; और Roblox में काम करते समय भी मैं PM को मना नहीं पाया, क्योंकि users मौजूदा तरीके से भी काम चला लेते हैं
    Arcball quaternion-based है और interpolation के लिए exponential functions इस्तेमाल करता है; एक ही drag में कोई भी rotation संभव है, gimbal lock नहीं होता, और closed loop बनाते हुए drag करने पर वह शुरुआती position पर वापस आ जाता है
    इसे mathematically इस fact से prove किया जा सकता है कि unit quaternions, SO(3) का double cover होते हैं; यह कुछ वैसा ही है जैसे circle पर rotations को unit complex numbers ठीक-ठीक represent करते हैं
    छूकर आज़माने लायक quaternion/Arcball reference implementation: https://romankogan.net/math/arcball_js/index.html
    Code बहुत-सी comments वाला Java है, और Processing library को ProcessingJS के जरिए JavaScript में चलाने के रूप में है
    हाथ और शरीर, दिमाग से पहले quaternions को समझ सकते हैं, इसलिए अगर आप 3D software बना रहे हैं तो अच्छा होगा कि यह तरीका अपनाएँ
    Arcball: http://courses.cms.caltech.edu/cs171/assignments/hw3/hw3-not...
    rotation के लिए quaternions: https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotati...
    Processing में Arcball: https://romankogan.net/math/arcball_js/index.html

    • सोचता हूँ कि center की जगह दाईं तरफ जैसे किसी point से drag करने पर यह इतना ज़्यादा खराब क्यों महसूस होता है। कुछ अटकने जैसा लगता है और कभी-कभी jump करता है; अगर rotation calculate करने का reference point बदलता है, तो उसका मतलब screen पर visually दिखना चाहिए
    • सोचता हूँ कि क्या इसे mobile पर भी काम कराने लायक बनाया जा सकता है
      अभी mobile पर देख रहा हूँ, और https://asliceofrendering.com/camera/2019/11/30/ArcballCamer... ने Arcball समझने में मदद की
  • इस context में समझ नहीं आता कि quaternions को इतना पसंद क्यों किया जाता है। Matrices को quaternions से कम intuitive मानना मुश्किल है
    Matrices vectors पर act करती हैं, और rotations भी vectors पर act करते हैं, तो rotation को matrix के रूप में देखने से ज़्यादा natural क्या होगा
    Matrix exponential भी ordinary differential equation से जोड़ें तो intuitive है। dx/dt = Ax का solution exp(t A) है, और अगर A skew-symmetric हो तो x में change हमेशा x के perpendicular होता है, इसलिए यह length नहीं बदलने वाला rotation बनता है
    Lie group/Lie algebra इसे बहुत generalize करता है, लेकिन core बात यह है कि perpendicular changes को continuously बनाकर rotation generate किया जाता है और exponential map उस process को explain करता है। यह picture कहीं ज़्यादा geometric और intuitive लगती है

    • Quaternion खुद भी अक्सर Pauli matrices जैसी matrices से represent किए जाते हैं, और यह quantum spin modeling में व्यापक रूप से इस्तेमाल होता है
      Quaternions का फायदा मुझे यह लगता है कि वही matrix multiplication हाथ से calculate करने की तुलना में, सिर्फ paper और pen से handle करना आसान होता है
      निजी तौर पर यह complex numbers जैसे अर्थ में intuitive है। शुरू में अजीब लगा था, लेकिन अब जिन alternatives को जानता हूँ, उनसे ज़्यादा simple लगता है—use करने और reasoning करने दोनों में
    • लेख में भी quaternions का matrices पर बड़ा advantage बताया गया था। Quaternions में interpolation अच्छा होता है, matrices में नहीं
      यह property animation या 3D spline curves के साथ frames calculate करने वाले graphics work में बहुत महत्वपूर्ण है
    • Calculation के नजरिए से quaternions का advantage यह है कि 3x3 matrix के 9 numbers की जगह सिर्फ 4 numbers लगते हैं, और rotation apply करने में भी operation count उसी तरह घटता है
    • Quaternions का मुख्य advantage rotation composition है
      यह 2D rotations को complex numbers से handle करने जैसा है: दो complex numbers को multiply करने पर rotations compose होते हैं और 2D में arguments add हो जाते हैं। उसी तरह दो quaternions को multiply करके 3D rotations compose किए जा सकते हैं, और यह 3x3 matrix multiplication से बहुत ज़्यादा efficient है
      intuition के लिए कहें तो quaternions का axis-angle representation से गहरा संबंध है, जो Lie algebra so(3) जैसा है
      vectors पर act करने के नजरिए से, अलग-अलग rotation parameterizations को उसी abstract Rotation trait के implementations की तरह देखा जा सकता है। अंदर implementation matrix, quaternion, Euler vector, Euler angles या Gibbs vector कुछ भी हो, rotation vectors पर act करता है और composition का तरीका समान होता है
  • Unit quaternions एक Lie group हैं, और अगर आप ऐसी चीज़ चाहते हैं जिसे मनमाने ढंग से जोड़ा जा सके, तो आपको rotation speed को दर्शाने वाले full quaternions के Lie algebra को देखना चाहिए। यह axis-angle rotational velocity को दर्शाने जैसा है
    unit quaternions और axis-angle की तुलना करना श्रेणी के लिहाज़ से थोड़ा mismatch है; unit quaternions की तुलना rotation matrices से, और full quaternions की तुलना axis-angle से करना ज़्यादा सही है
    quaternions इस्तेमाल करने का एक फायदा यह है कि exponential map आसानी से compute किया जा सकता है, लेकिन quaternions इस्तेमाल करते समय rotation matrices की बहुत कम ज़रूरत पड़ती है। लेख की तरह pqp^-1 से rotation compute किया जा सकता है
    quaternions को समझने का सबसे आसान रास्ता मुझे geometric algebra पढ़ना लगता है। quaternions के आविष्कार में सैकड़ों साल लगे, लेकिन हैरान करने वाली सरल geometric algebra समझ लें तो कुछ ही मिनटों में quaternions को फिर से derive कर सकते हैं
    कुछ साल पहले जो अच्छा introduction लगा था: https://crypto.stanford.edu/~blynn/haskell/ga.html

    • rotations के बारे में सोचते समय मुझे अब भी exponential map सबसे robust तरीका लगता है। क्योंकि यह SO(3) के Lie group को coordinate transforms, differentiation और tangent space handling तक सबसे सीधे तरीके से handle करने देता है
      geometric algebra की कई formalizations से गुजरने के बाद भी अंत में SO(3)/SE(3) spaces को represent करने के लिए rotors और motors इस्तेमाल करने पड़ते हैं, जो क्रमशः quaternions और dual quaternions के isomorphic हैं
      लेकिन उस उद्देश्य के लिए मुझे exponential map के साथ 3x3 rotation matrices और 4x4 transformation matrices अब भी कहीं ज़्यादा उपयोगी लगते हैं। quaternions कम storage लेते हैं और उन्हें आपस में multiply करना भी तेज़ है, लेकिन points transform करते समय matrices तेज़ होती हैं, और कुल efficiency situation पर निर्भर करती है
    • यहाँ “full quaternions” से आपका मतलब pure imaginary quaternions था या नहीं, यह जानना चाहूँगा
  • यूनिवर्सिटी में सीखी गई शानदार चीज़ों में से एक यह थी कि अगर + operator को matrix और vector-space deltas के हिसाब से, और - operator को दो matrices के हिसाब से redefine कर दें, तो Kalman filter state के अंदर rotation matrix को सीधे रखा जा सकता है
    ऐसा करने से gimbal lock की चिंता किए बिना rotations estimate किए जा सकते हैं
    https://openslam-org.github.io/MTK

    • क्या आपका मतलब SO(2) के tangent space को state के रूप में रखने से है?
    • tangent space में + operator implement करना सिर्फ Kalman filters में ही नहीं, बल्कि nonlinear optimization में भी काफ़ी आम है। Ceres library भी इसके लिए LocalParameterization support करती है
  • यह वाकई अच्छा था, और सिर्फ छोटे हिस्से ही अच्छे नहीं थे
    खास तौर पर मुझे यह बात पसंद आई कि ये तरीके आखिर में standard rotation matrix compute करते हैं। अगर आपको दस लाख vectors rotate करने हैं, तो interesting computation सिर्फ एक बार करें, और उसके बाद highly optimized matrix multiplication pipeline चला दें

  • ब्लॉग शानदार था, लेकिन लेखक की profile पर क्लिक करके दूसरे लेख देखते हुए मुझे यह वाक्य दिखा: “2010 के आसपास, 9 साल की उम्र में पहली बार programming से परिचय हुआ”
    मैं 2010 में 13 साल का था और middle-school maths और science दिमाग में भरने की कोशिश कर रहा था
    जब भी मैं computer graphics पर कोई शानदार लेख देखता हूँ, लगता है वह मुझसे कम उम्र और कहीं ज़्यादा प्रतिभाशाली व्यक्ति ने लिखा है, और गहरी हीन भावना महसूस होती है

    • अभी देर नहीं हुई है। पिछले कुछ सालों में मैंने self-study से एक niche technology सीखी, और लगता है कोई बड़ी कंपनी उसे पैसे देकर इस्तेमाल करना चाहती है। मेरी उम्र करीब 35 साल है
      हालांकि मैं यह सलाह ठीक से नहीं दे पाऊँगा कि कैसे करें। मैंने बस उसे सचमुच पसंद किया और करता रहा। फिर भी structured practice जैसी चीज़ें भी काम कर सकती हैं, ऐसा लगता है
  • कई rotations का average निकालने का तरीका खोजते हुए मुझे https://mathweb.ucsd.edu/~sbuss/ResearchWeb/spheremean/paper... मिला
    इस लेख का तरीका, कम-से-कम मेरे math level पर, उस paper से कहीं आसान लगता है

    • कई rotations का average निकालने का context जानना चाहूँगा
      average वह काम है जो addition से किया जा सकता है, और addition में composition का order महत्वपूर्ण नहीं होता। लेकिन rotations commutative नहीं होते, इसलिए average की हमारी सामान्य समझ वैसे ही लागू नहीं होती
      फोन हाथ में लेकर screen को 180° घुमाकर दूर की ओर करें, फिर ज़मीन के reference में clockwise 90° घुमाएँ, तो camera बाईं ओर देखेगा। उल्टा, यही दो rotations reverse order में करें तो camera दाईं ओर देखेगा
      इन दो rotations के “average” में camera किस ओर देखना चाहिए, इसका कोई एक answer नहीं है; यह इस पर निर्भर करता है कि आप average से कौन-सी properties चाहते हैं
    • कुछ दिन पहले मैंने plane rotations से जुड़ी थोड़ी tangential comment लिखी थी। plane में यह कहीं ज़्यादा सरल हो जाता है, और programming environment complex-number operations को first-class feature के रूप में support करे तो खास तौर पर सुविधाजनक होता है
      https://news.ycombinator.com/item?id=40333541
      core intuition यह है कि addition translation है और multiplication rotation। इसलिए average translation के लिए arithmetic mean और average rotation के लिए geometric mean इस्तेमाल किया जा सकता है
  • यह समझने में मुझे काफी समय लगा कि math में भी abstractions उसी तरह बनाई जाती हैं जैसे software engineering में abstractions के बारे में सोचते हैं
    बचपन में मैं उलझता था कि imaginary numbers क्यों बनाए गए, और matrices का आखिर मतलब क्या है
    बाद में समझ आया कि ये representations design की गई हैं। imaginary numbers नाम की चीज़ बनाने से कुछ computations आसान हो जाते हैं, और linear equations को matrix के रूप में लिखना सब कुछ खोलकर लिखने की तुलना में reasoning के लिए कहीं आसान होता है
    यह obvious लगता है, लेकिन किसी ने मुझे इस तरह नहीं बताया था

    • ज़्यादा abstract math पढ़ने पर भी यह दृष्टिकोण सही बना रहता है। उदाहरण के लिए, group एक interface है, और “कोई group” उस type की तरह देखा जा सकता है जिसमें ऐसी operation हो जो ज़रूरी तीन properties/methods implement करती हो
      vector spaces, rings, metric spaces और categories के लिए भी यही बात है; math design patterns के रूप में interfaces से भरा है
      हालांकि math के interfaces programming inheritance से ज़्यादा type classes जैसे हैं। क्योंकि वही set/type कई तरीकों से group बन सकता है