simple point function seems strange

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

simple point function seems strange

Stéphane Ducasse
Hi

(10@20) rotateBy: #left centerAt: 0 @0
        returns
                20@ -10

and my math tells me that this is a rotation to the right.

Am I correct?
Then why I'm wrong? screen coordinates vs. math coordinate?

Stef

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: simple point function seems strange

Nicolas Cellier


2010/7/8 Stéphane Ducasse <[hidden email]>
Hi

(10@20) rotateBy: #left centerAt: 0 @0
       returns
               20@ -10

and my math tells me that this is a rotation to the right.

Am I correct?
Then why I'm wrong? screen coordinates vs. math coordinate?

Sure.
 

Stef

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: simple point function seems strange

Henrik Sperre Johansen
In reply to this post by Stéphane Ducasse
  On 08.07.2010 00:11, Stéphane Ducasse wrote:

> Hi
>
> (10@20) rotateBy: #left centerAt: 0 @0
> returns
> 20@ -10
>
> and my math tells me that this is a rotation to the right.
>
> Am I correct?
> Then why I'm wrong? screen coordinates vs. math coordinate?
>
> Stef
You rotate around the center, left is compared to the center ->  point vector, not the other way around.

Cheers,
Henry



_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: simple point function seems strange

Henrik Sperre Johansen
  On 08.07.2010 00:26, Henrik Sperre Johansen wrote:

>  On 08.07.2010 00:11, Stéphane Ducasse wrote:
>> Hi
>>
>> (10@20) rotateBy: #left centerAt: 0 @0
>>     returns
>>         20@ -10
>>
>> and my math tells me that this is a rotation to the right.
>>
>> Am I correct?
>> Then why I'm wrong? screen coordinates vs. math coordinate?
>>
>> Stef
> You rotate around the center, left is compared to the center ->  point
> vector, not the other way around.
>
> Cheers,
> Henry
... assuming you use screen coordinates of course, starting at top left :)



_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: simple point function seems strange

Stéphane Ducasse
I was stupid to think that the rotation did not depend on the origin and coordinate system.

Stef

On Jul 8, 2010, at 12:28 AM, Henrik Sperre Johansen wrote:

> On 08.07.2010 00:26, Henrik Sperre Johansen wrote:
>> On 08.07.2010 00:11, Stéphane Ducasse wrote:
>>> Hi
>>>
>>> (10@20) rotateBy: #left centerAt: 0 @0
>>>    returns
>>>        20@ -10
>>>
>>> and my math tells me that this is a rotation to the right.
>>>
>>> Am I correct?
>>> Then why I'm wrong? screen coordinates vs. math coordinate?
>>>
>>> Stef
>> You rotate around the center, left is compared to the center ->  point vector, not the other way around.

yes but



               


>>
>> Cheers,
>> Henry
> ... assuming you use screen coordinates of course, starting at top left :)
>
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project