[Jprogramming] A plane rotation
Raul Miller
rauldmiller at gmail.com
Wed Feb 17 05:14:22 UTC 2016
Well...
rottheta=: (rot~ r.)~
1r2p1 rottheta 3 4
_4 3
1r4p1 rottheta _1 1
_1.41421 1.11022e_16
I remember there being a concise phrase to clean irrelevant bits near
zero in a complex number, but I can't remember what I need to search
on to find it, and my foggy memory of how to write it is failing me at
the moment.
Still, this gets you close.
--
Raul
On Tue, Feb 16, 2016 at 11:50 PM, Kip Murray <thekipmurray at gmail.com> wrote:
> I'm retired with time to "fool around". Finding an old rot90 verb that
> used multiplication by a 2 by 2 matrix, I sought a more direct way using
> complex numbers and found one of the solutions that was posted. I also
> learned a lot from the other solutions posted, thanks everyone!
>
> New puzzle: find a complex analysis way to do a rotation given its angle in
> radians, examples:
>
> 1r2p1 rottheta 3 4
> _4 3
>
> 1r4p1 rottheta _1 1
> _1.414213562 0
>
> --Kip
>
> I'm also a former math professor!
>
> On Tuesday, February 16, 2016, David Lambert <b49p23tivg at gmail.com> wrote:
>
>>
>> what's your agenda, are you writing a book? Isn't there a homogeneous
>> coordinate system/transformation lab?
>>
>>>
>>> On 02/16/2016 06:16 PM, programming-request at forums.jsoftware.com wrote:
>>>
>>>> Date: Tue, 16 Feb 2016 15:18:43 -0600
>>>> From: Kip Murray<thekipmurray at gmail.com>
>>>> To:"programming at jsoftware.com" <programming at jsoftware.com>
>>>> Subject: [Jprogramming] A plane rotation
>>>> Message-ID:
>>>> <CAOfWorgVyDB1NmJwXkB0WOSYFnLUBXCDZ20sV11ukSFCfay5sA at mail.gmail.com>
>>>> Content-Type: text/plain; charset=UTF-8
>>>>
>>>> Fairly easy: write a verb that rotates a point in the plane by the angle
>>>> of
>>>> a given complex number. For example
>>>>
>>>> 1j1 rot 1 1 NB. Rotate 1 1 counterclockwise 45 degrees
>>>> 0 1.414213562
>>>>
>>>> Background information: when you multiply two complex numbers the
>>>> magnitudes are multiplied and the angles are added.
>>>>
>>>> --Kip Murray
>>>>
>>>>
>>>
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
>
>
>
> --
> Sent from Gmail Mobile
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
More information about the Programming
mailing list