### Author Topic: direction shape faces when rotation is 0  (Read 621 times)

0 Members and 1 Guest are viewing this topic.

#### Flaze07

• Jr. Member
• Posts: 64
##### direction shape faces when rotation is 0
« on: July 14, 2017, 06:11:41 pm »
hi, is the direction of shape (rectangle) upward, left, right, or downward when it has the rotation of zero

#### Laurent

• Hero Member
• Posts: 32261
##### Re: direction shape faces when rotation is 0
« Reply #1 on: July 14, 2017, 09:04:02 pm »
cos(0) == 1 (X axis)
sin(0) == 0 (Y axis)

So, in default SFML coordinates, angle zero is towards the right.
Laurent Gomila - SFML developer

#### Flaze07

• Jr. Member
• Posts: 64
##### Re: direction shape faces when rotation is 0
« Reply #2 on: July 15, 2017, 04:51:45 am »
I see...so it is not up...well the whole time I thought it was up

#### Hapax

• Hero Member
• Posts: 2824
• My number of posts is shown in hexadecimal.
##### Re: direction shape faces when rotation is 0
« Reply #3 on: July 16, 2017, 12:44:07 pm »
I'm not sure that a rectangle can be described that clearly as having a "direction". Is its width the direction of the rectangle or its height? I suppose it would depend on which is 'longer'.

If its rotation is zero, its width is to the right and its height is downwards.

Selba Ward - SFML drawables
Kairos - Timing Library
Rectangular Boundary Collision - Rectangular SAT Collision