Skip to content

Feat/rotate matrix#1984

Merged
josdejong merged 11 commits into
josdejong:developfrom
rnd-debug:feat/rotate-matrix
Oct 7, 2020
Merged

Feat/rotate matrix#1984
josdejong merged 11 commits into
josdejong:developfrom
rnd-debug:feat/rotate-matrix

Conversation

@rnd-debug
Copy link
Copy Markdown
Contributor

@rnd-debug rnd-debug commented Oct 3, 2020

Related to #1160

  • Implement rotationMatrix(theta, v, format)
  • Unit tests
  • Header in the code
  • Embedded docs
  • Latex support (not sure)

Questions:

  • should I provide a "complete Latex support"? For the moment, toTex will convert to mathrm.

Will provide rotate(w, theta) as alias for multiply(rotationMatrix(theta), w) in another MR if this one is accepted.

@josdejong
Copy link
Copy Markdown
Owner

Thanks @rnd-debug , this PR looks good and ready to merge 👍 . Great that you've added support for units. A function rotate(w, theta) on top of this will make this really interesting!

* should I provide a "complete Latex support"? For the moment, `toTex` will convert to `mathrm`.

I'm not sure what you mean with "complete" Latex support. Isn't rotationMatrix just a regular function like say sin? In that case we could render it just like other functions as \rotationMatrix\left(...\right). Or is there a special Latex notation for rotation matrices?

@rnd-debug
Copy link
Copy Markdown
Contributor Author

sin is one of the few "standard" functions, so it is recognized when we write \sin and will produce a nice roman font when inside an equation block.
If we try to do the same (\rotationMatrix) with non-standard functions, it will fail to output: we have to call mathrm explicitely. I don't think that there is a particular Latex syntax for rotations, so I assume we can live with the current version of math.parse('rotationMatrix(1)').toTex(), that produces a \mathrm.

A small example below:

\begin{equation}
  \begin{align*}
    \cos(\theta) \\
    cos(\theta) \\
    \rotationMatrix(\theta) \\
    rotationMatrix(\theta) \\
    \mathrm{rotationMatrix(\theta)}
  \end{align*}
\end{equation}

image

@josdejong
Copy link
Copy Markdown
Owner

I don't think that there is a particular Latex syntax for rotations, so I assume we can live with the current version of

Thanks for the explanation, I agree, looks good like this 👍 . Thanks again, will merge your PR now.

@josdejong josdejong merged commit 439ec41 into josdejong:develop Oct 7, 2020
@josdejong
Copy link
Copy Markdown
Owner

Available now in v7.4.0, thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants