{{ message }}
/ mathjs Public

# 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

This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters

### rnd-debug commented Oct 3, 2020 • edited

Related to #1160

• Implement rotationMatrix(theta, v, format)
• Unit tests
• 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.

and others added 11 commits Oct 3, 2020
 providing rotationMatrix(theta, v) 
 9ed3541 
 Merge branch 'develop' of https://github.com/josdejong/mathjs into fe… 
 e0e4449 
…at/rotate-matrix
 increase coverage 
 5e259bf 
 adding latex test as is 
 f38f3cf 
 fixing rounding issues with math.pi 
 0e2dc1d 
 fixing lint 
 b72ab08 
 Update rotationMatrix.js 
 5490613 
remove non-sense doc
 Update rotationMatrix.js 
 ae9b927 
Remove non-sense from docs
 removing nonsense from docs 
 6563ddd 
 Renaming functions 
 efd43e4 
 Merge branch 'develop' into feat/rotate-matrix 
 f75df2a 

### 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 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}

### 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.

merged commit 439ec41 into josdejong:develop Oct 7, 2020
4 checks passed

### josdejong commented Oct 7, 2020

 Available now in v7.4.0, thanks again.