question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add unit type to rotation and skew methods

See original GitHub issue

Something that allows you to specify the unit for rotation, such as rad or turn Rematrix.rotate(0.5, 'rad') perhaps?

@davidkpiano

Units

  • deg — Degrees. There are 360 degrees in a full circle.
  • grad — Gradians, also known as “gons” or “grades”. There are 400 gradians in a full circle.
  • rad — Radians. There are 2π radians in a full circle.
  • turn — Turns. There is 1 turn in a full circle.

Source: https://drafts.csswg.org/css-values-3/#angles

Re: #1

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jlmakescommented, Jul 29, 2019

I rather like the first suggestion, as it handles two arguments passed to skew nicely:

const { deg, turn } = Rematrix
Rematrix.skew(deg(45), turn(0.5))
0reactions
davidkpianocommented, Nov 11, 2017

Another option: (not a breaking change, just add static methods to the rotate() function)

Rematrix.rotate.deg(180)
Rematrix.rotate.turn(.5)
Rematrix.rotate.grad(200)
Read more comments on GitHub >

github_iconTop Results From Across the Web

skew() - CSS: Cascading Style Sheets - MDN Web Docs
The skew() CSS function defines a transformation that skews an element on the 2D plane. Its result is a <transform-function> data type.
Read more >
Coordinate Systems, Transformations and Units – SVG Tiny 1.2
7 Coordinate Systems, Transformations and Units ... and represent the usual method of controlling the size, position, rotation and skew of graphic objects....
Read more >
Lecture 18: Rotation and How to Represent It, Unit ... - YouTube
MIT 6.801 Machine Vision, Fall 2020Instructor: Berthold HornView the complete course: https://ocw.mit.edu/6-801F20YouTube Playlist: ...
Read more >
Rotations, Orientation, and Quaternions - MATLAB & Simulink
This example reviews concepts in three-dimensional rotations and how quaternions are used to describe orientation and rotations. Quaternions are a skew ...
Read more >
CSS 2D Transforms - W3Schools
The matrix() method take six parameters, containing mathematic functions, which allows you to rotate, scale, move (translate), and skew elements. The parameters ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found