-2

what does the ' mean in x' y' and what is cos(a) what is the 'a' equal to what is it? How am I to understand what x' and 'a' is if they don't remember to write the equation then put that 'a' is equal to .... whatever? so I can figure it out? how am I to know what to put into the cos(?) and sin(?) if I don't know what 'a' is equal to?

x' = x * (width' / width)
y' = y * (height' / height)

Mapping for rotation is only a little bit harder.

x' = x * cos(a) + y * sin(a)
y' = y * cos(a) - x * sin(a)

I am trying to figure out how to find the destination_x, destination_y, angle_x, angle_y for displaying an image into the desktop and angles and rescale it to show it properly I keep getting the image to show but not where I want it -- center screen -- and it is chopped off at angles into polygons, hexagons mollymoolygons and what not. My fingers are googled out. ~

luser droog
  • 18,988
  • 3
  • 53
  • 105
uxserx-bw
  • 241
  • 1
  • 2
  • 10
  • 4
    This question appears to be off-topic because it is about maths. – Oliver Charlesworth Jan 04 '14 at 22:21
  • @OliCharlesworth No, it is about "progtamming". OP has put a tad bit of effort into asking this question, hasn't he... –  Jan 04 '14 at 22:25
  • That being said, I guess you're looking for an explanation like what's on the [wikipedia page](http://en.wikipedia.org/wiki/Rotation_(mathematics)#Matrix_algebra). – Joshua Nelson Jan 04 '14 at 22:25
  • that's funny because the example I used is off this sight -- and I just did not user stand that answer so I put it up for some one could explain it to me, and NO one said it was OFF TOPIC in that question pertaining to the same subject.. funny how people are so like that .. – uxserx-bw Jan 04 '14 at 22:35
  • I guess you got this page 'off the site' [sp.]: http://stackoverflow.com/a/299383/2564301. But it has nothing to do with *programming*, it's fairly conventional mathematics notation. `x'` is "x derived", `a` is because it's hard to type the more common `ɑ` on a conventional keyboard (and it doesn't matter anyway 'cause both are understood to stand for 'angle'). But .. if you don't know what "cos" is, then all of this won't help you a bit. – Jongware Jan 04 '14 at 22:46
  • This question appears to be off-topic because it it belongs to http://math.stackexchange.com/ – Lajos Veres Jan 04 '14 at 22:47
  • like I am suppose to know every web sight on the INTERNET hahaha – uxserx-bw Jan 05 '14 at 00:16

1 Answers1

0

a is the input angle. sin and cos are trigonometric functions that help you to calculate positions based on this angle.

x' and y' are the output from the functions. You'll still need to use them as (x,y) coordinates, but the prime symbol indicates that the values have changed because of the function. This is particularly important in your second set of equations:

x' = x * cos(a) + y * sin(a)
y' = y * cos(a) - x * sin(a)

The equation to derive y' uses plain x, the old x, not the new one derived in the equation just above it.

The commentators and closers are also correct that this is not a programming question per se. Rather this is part of the math needed in the domains of computer graphics and image processing. Specifically these are equations or functions for coordinate transformation. In programming this is usually done with matrix multiplication.

luser droog
  • 18,988
  • 3
  • 53
  • 105