It is currently Sun Jul 21, 2024 3:19 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: offset in pixel vs. angle
PostPosted: Mon Jan 21, 2013 2:41 am  (#1) 
Offline
GimpChat Member
User avatar

Joined: Jul 17, 2012
Posts: 2770
is there an easy way to calculate offset in pixels for a specific angle ?

for example, i want to offset an object by 135°
how much is that in pixels in the offset dialogue (Strg +O) ?

90 and 180° are pretty obivious, how about other angles ?


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: offset in pixel vs. angle
PostPosted: Mon Jan 21, 2013 3:29 am  (#2) 
Offline
GimpChat Member
User avatar

Joined: Sep 22, 2012
Posts: 2089
Location: US
I would use the Measurement tool

Image


and then offset


Image


Top
 Post subject: Re: offset in pixel vs. angle
PostPosted: Mon Jan 21, 2013 3:36 am  (#3) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
If you are moving your object a distance D at an angle A then the you compute the x and y offsets with the following formula:

x = D * cos(A)
y = D * sin(A)

Where 'cos' and 'sin' are the mathematical cosine and sine functions respectively.

If you are writing a script or plug-in, you should be aware that the angle provided to the 'cos' and 'sin' functions are typically specified in radians, rather than degrees. To convert between radians and degrees, the following equation applies:

1 radian = 180 / π degrees
or
1 radian ≈ 57.3 degrees

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: offset in pixel vs. angle
PostPosted: Mon Jan 21, 2013 8:11 am  (#4) 
Offline
GimpChat Member
User avatar

Joined: Jul 17, 2012
Posts: 2770
thank you guys, will check that out later


Top
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) Line/pixel size doesnot correspond with pixel resolution

3

No new posts Attachment(s) S640 pen cursor offset with brush

0

No new posts Attachment(s) Pixel Art Help

2

No new posts Pixel art experiment

6

No new posts Attachment(s) Use Shrink or Grow by 1 pixel on command

12



* Login  



Powered by phpBB3 © phpBB Group