Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/rotate matrix #1984

Merged
merged 11 commits into from Oct 7, 2020
Merged

Feat/rotate matrix #1984

merged 11 commits into from Oct 7, 2020

Conversation

rnd-debug
Copy link
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
Owner

@josdejong josdejong commented Oct 7, 2020

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
Contributor Author

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

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
Owner

@josdejong josdejong commented Oct 7, 2020

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
4 checks passed
@josdejong
Copy link
Owner

@josdejong josdejong commented Oct 7, 2020

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.

None yet

2 participants