Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

how to mathematically express a relationship in which a vector can be any 3D unit vector

+3
−0

I'm currently doing some work with 3D rotations and exponential coordinates. Exponential coordinates $\mathbf{s} \in \mathbb{R}^3$ are a rotation parameterization defined as $$\mathbf{s} = \theta \mathbf{e}$$ where $\mathbf{e} \in \mathbb{R}^3$ is a unit-length axis of rotation, and $\theta \in [0,\pi]$ is an angle of rotation. The set of all axes is equivalent to the 2-sphere, $\mathcal{S}^2$: $$\mathcal{S}^2 = \{ \mathbf{x} \in \mathbb{R}^3 ~~~ | ~~~ \lVert \mathbf{x} \rVert = 1 \} .$$

Given a set of exponential coordinates $\mathbf{s}$, the angle can be recovered as follows: $$\theta = \lVert \mathbf{s} \rVert .$$ If $\lVert \mathbf{s} \rVert \neq 0$, then the axis can be recovered as follows: $$\mathbf{e} = \mathbf{s}/\lVert \mathbf{s} \rVert .$$ However, if $\lVert \mathbf{s} \rVert = 0$, then any unit-length axis can be used as the axis $\mathbf{e}$.

I'm wondering how to express this relationship as an equation. Below are some of my ideas, but none are entirely satisfactory to me:

idea 1: $$\mathbf{e} = \begin{cases} \mathbf{s}/\lVert \mathbf{s} \rVert, & \lVert \mathbf{s} \rVert \neq 0 \\ \text{any 3D unit vector}, & \lVert \mathbf{s} \rVert = 0 \end{cases}$$

idea 2: \begin{align} \mathbf{e} &= \mathbf{s}/\lVert \mathbf{s} \rVert, & \lVert \mathbf{s} \rVert &\neq 0\\ \mathbf{e} &\in \mathcal{S}^2, & \lVert \mathbf{s} \rVert &= 0 \end{align}

idea 3: $$\mathbf{e} = \begin{cases} \mathbf{s}/\lVert \mathbf{s} \rVert, & \lVert \mathbf{s} \rVert \neq 0 \\ \mathbf{x} ~~~ | ~~~ \mathbf{x} \in \mathbb{R}^3, ~\lVert \mathbf{x} \rVert = 1, & \lVert \mathbf{s} \rVert = 0 \end{cases}$$

What is the best way to express the relationship/mapping from $\mathbf{s}$ to $\mathbf{e}$ mathematically (using the equations above or something else)?

History
Why does this post require attention from curators or moderators?
You might want to add some details to your flag.
Why should this post be closed?

0 comment threads

2 answers

You are accessing this answer with a direct link, so it's being shown above all other answers regardless of its score. You can return to the normal view.

+2
−0

What makes the most sense to do somewhat depends on the context of this expression.

What it seems you are really trying to do is defined $\mathbf e$ as a function of $\mathbf s$. What's making it awkward is that $\mathbf e$ isn't a function of $\mathbf s$ but merely a total (multi-valued) relation on $\mathbf s$. Thus the Right solution is to address this head-on. You could do this by having $\mathbf e$ be a set-valued function or by having something like an $\mathsf{axis\_of}$ relation. Specifically, $$\mathbf e(\mathbf s) = \begin{cases}\mathbf \{\mathbf s / \lVert\mathbf s\rVert\}, & \lVert\mathbf s\rVert \neq 0 \\ \mathcal S^2, & \lVert\mathbf s\rVert = 0\end{cases}$$ or $$\mathsf{axis\_of}(\mathbf e, \mathbf s) \iff (\lVert\mathbf s\rVert = 0 \land e \in \mathcal S^2) \lor (\lVert\mathbf s\rVert \neq 0 \land e = \mathbf s / \lVert\mathbf s\rVert)$$ The latter formula could be simplified in various ways, e.g. $$\mathbf e \in \mathcal S^2 \land (\lVert\mathbf s\rVert \neq 0 \implies \mathbf e = \mathbf s/\lVert\mathbf s\rVert)$$ Incidentally, the definition of $\mathsf{axis\_of}$ is a direct answer to your title question.

Now I will talk about various less Right options. Why do this? First, it is perfectly valid and quite doable to do things the way I described above. But it will also feel weird and often be clumsy[1]. And all this for one particular edge case. Essentially, the (non-functional) relational nature of $\mathbf e$ pollutes everything it touches.

One only slightly less Right approach is to make an arbitrary choice. Unlike the situation with division of numbers (where we have a non-functional relation as well but in that case a partial, single-valued one), you have options. One way of doing this is to only partially axiomatize/specify the $\mathbf e$ function. This is easy enough to do informally, but I'll also explain how it would be done formally. Essentially, you add $\mathbf e$ as a new function symbol[2] and add axioms $\forall\mathbf s \in \mathcal E.\mathbf e(\mathbf s) \in \mathcal S^2$ and $\forall\mathbf s \in \mathcal E.\lVert\mathbf s\rVert \neq 0 \implies \mathbf e(\mathbf s) = \mathbf s / \lVert\mathbf s\rVert$ where $\mathcal E$ will be the set of exponential coordinates[3]. The value of $\mathbf e(\mathbf 0)$ is not (logically) decidable from these axioms but it is a particular but unknown value constrained to lie in $\mathcal S^2$. That is, $\mathbf e(\mathbf 0) = \mathbf e(\mathbf 0)$ is true[4]. Note how $1/0 = 1/0$ is not true. This seeming equation between expressions is actually shorthand for a predicate unrelated to equality. Of course, you could just specify the value, say $(1, 0, 0)$ (making clear that this choice is arbitrary). The only real downside to this is that it is technically possible to write theorems that depend on this choice.

Finally, you can do what is done for division of numbers: implicitly add constraints to restrict the relation to the domain on which it is single-valued and thus a function. That said, the situation isn't nearly as bad as for division. Per the previous paragraph, as long as $\mathbf e(\mathbf 0)$ is treated as having a consistent if unknown value — which is the natural thing to do — there won't be any problems.


  1. Things like Eugenio Moggi's monadic metalanguage would help partially recover some ergonomics for the set-valued function case. ↩︎

  2. If you're familiar with the notion or as an introduction to the notion, $\mathbf e$ is essentially a Skolem function for the formula $\forall\mathbf s\in\mathcal E.\exists \mathbf e.\mathsf{axis\_of}(\mathbf e, \mathbf s)$. ↩︎

  3. Which is to say, add the axiom $\forall \mathbf s \in \mathcal E.\mathsf{axis\_of}(\mathbf e(\mathbf s), \mathbf s)$. ↩︎

  4. The relational equivalent of this would be $\mathsf{axis\_of}(\mathbf e, \mathbf s) \land \mathsf{axis\_of}(\mathbf e', \mathbf s) \implies \mathbf e = \mathbf e'$ which is false and the whole reason we're in this situation. ↩︎

History
Why does this post require attention from curators or moderators?
You might want to add some details to your flag.

0 comment threads

+2
−0

If I understand the situation correctly, the problematic issue is the zero rotation, and the issue is that if you do not rotate things at all, than that corresponds to a zero rotation around any axis.

If this is true, then I could understand any of your three ideas. The third one might be marginally harder to read because of the spacing, but that can be dealt with; it is typography, not mathematics.

In idea two you might want to add the word «or».

But generally, I would use whichever is clearest and uses as similar notations as you use for similar ideas in the rest of the text.

History
Why does this post require attention from curators or moderators?
You might want to add some details to your flag.

1 comment thread

Thanks for the response. Do you have any suggestions of how to add curly braces to **idea 2**? I'm no... (2 comments)

Sign up to answer this question »