Millisecond Forums

Coordinate system

https://forums.millisecond.com/Topic27952.aspx

By nakayama - 11/5/2019


Hi, Dave,
This maybe an old question. I wish to calculate the coordinate of  (a,b) in pixels under the screen resolution of (1960,1200). The angle between is 10 degree.
Is there a formula I could refer to? I used something like this but does work.

/ circle_a=1px*(expressions.circle_x+300*cos(0.174533))
/ circle_b=1px*(expressions.circle_y+300*sin(0.174533))

Thank you ;)

By nakayama - 11/5/2019

nakayama - 11/5/2019

Hi, Dave,
This maybe an old question. I wish to calculate the coordinate of  (a,b) in pixels under the screen resolution of (1960,1200). The angle between is 10 degree.
Is there a formula I could refer to? I used something like this but does work.

/ circle_a=1px*(expressions.circle_x+300*cos(0.174533))
/ circle_b=1px*(expressions.circle_y+300*sin(0.174533))

Thank you ;)


*(960, 1000) is (x,y)
By Dave - 11/5/2019

nakayama - 11/6/2019
nakayama - 11/5/2019

Hi, Dave,
This maybe an old question. I wish to calculate the coordinate of  (a,b) in pixels under the screen resolution of (1960,1200). The angle between is 10 degree.
Is there a formula I could refer to? I used something like this but does work.

/ circle_a=1px*(expressions.circle_x+300*cos(0.174533))
/ circle_b=1px*(expressions.circle_y+300*sin(0.174533))

Thank you ;)


*(960, 1000) is (x,y)

<expressions>
/ theta = (values.angle)*(m_pi/180)
/ deltax = values.radius*cos(expressions.theta)
/ deltay = values.radius*sin(expressions.theta)
/ a = values.x+expressions.deltax
/ b = values.y+expressions.deltay
</expressions>

<values>
/ x = 960px
/ y = 1000px
/ radius = 300px
/ angle = -10
</values>

<shape xy>
/ shape = circle
/ size = (40px, 40px)
/ color = blue
/ hposition = values.x
/ vposition = values.y
</shape>

<shape ab>
/ shape = circle
/ size = (40px, 40px)
/ color = red
/ hposition = expressions.a
/ vposition = expressions.b
</shape>

<trial example>
/ stimulusframes = [1=xy, ab]
/ validresponse = (57)
</trial>