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

Function to convert angles into 2D unit vectors #23

Closed
fryguybob opened this issue Aug 4, 2012 · 1 comment
Closed

Function to convert angles into 2D unit vectors #23

fryguybob opened this issue Aug 4, 2012 · 1 comment

Comments

@fryguybob
Copy link
Member

(Imported from http://code.google.com/p/diagrams/issues/detail?id=49. Original issue from byor...@gmail.com on September 6, 2011, 04:54:01 PM UTC)

Suggested by Anton Kholomiov <anton.kholomiov@gmail.com>:

> - I'm using it with function e (like complex vector representation e^ix)
>
> e a = (cos $ tau_a, sin $ tau * a)
>
> And we can define rectangle point-chain like this:
>
> [e 0, 4 ^_ e 0.25, e 0.5, 4 ^* e 0.75]
>
> With e you can define
>
> unitX = e 0
> unitY = e 0.25
> unit_X = -1 ^* e 0

I don't think 'e' is the best name since it is not very self-documenting (although it is suggestive of the polar form of complex numbers). Also, it should take any Angle instance rather than being limited to CircleFrac. But the idea is good, and we ought to add such a function to Diagrams.TwoD.Util (well... 'direction' is already in that module, and this new function should go in the same module as direction, since they are dual, but perhaps both should be moved to a new module like Diagrams.TwoD.Vector).

@fryguybob
Copy link
Member Author

(Imported. Original comment by byor...@gmail.com on September 8, 2011, 05:49:08 PM UTC)

However, nothing stops us from having a more descriptive name and ALSO keeping 'e' as a short synonym.

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

No branches or pull requests

1 participant