(no title)
b2gills | 4 years ago
# this assumes that ϕ, ψ, and θ have already been set
my \cϕ = ϕ.cos; my \sϕ = ϕ.sin;
my \cψ = ψ.cos; my \sψ = ψ.sin;
my \cθ = θ.cos; my \sθ = θ.sin;
my \alpha = [ cψ×cϕ−cθ×sϕ×sψ, cψ×sϕ+cθ×cϕ×sψ, sψ×sθ;
−sψ×cϕ−cθ×sϕ×cψ, −sψ×sϕ+cθ×cϕ×cψ, cψ×sθ;
sθ×sϕ, −sθ×cϕ, cθ];
I'm not sure if using × helps or hurts in this case since I'm not really experienced in this area.These all work because Unicode defines ϕψθ as "Letter lowercase"
say "ϕψθ".uniprops;
# (Ll Ll Ll)
---I would like to note that I used the Unicode "Minus Sign" "−" U+2212 so that it wouldn't complain about not being able to find a routine named "cϕ-cθ". (A space next to the "-" would have also sufficed.)
a1369209993|4 years ago
Blech; looks like a letter and normalizes cross products. Better to use "·" (U+B7)[0]:
Minus sign is a nice-to-have, though.0: Also "∧" (U+2227, wedge), the real other vector product[1], but that doesn't matter for scalar multiplication.
1: http://en.wikipedia.org/wiki/Wedge_product
b2gills|4 years ago
If you need more control you can write it out
I made it chaining for the same reason `+` and `×` are chaining.---
I don't know enough about the topic to know how to properly write `∧`.
It looks like it may be useful to write it using multis.
If it was as simple as just a normal cross product, that would have been easy. Of course, I'm fairly confident that is wrong.