My code works here, but my current method is very inefficient and time consuming. I generate 4 Cartesian coordinates and add them to the list. Then I create 4 Psychopy line objects (visual.Line) and assign each object an x, y coordinate from my coordinate list (zdot_list). I am currently creating 4 lines of objects one by one and assigning xy positions to each "start" parameter.
from psychopy import visual, core, event, sound
import random
import math
win = visual.Window([800,600],color=(0,0,0), colorSpace='rgb', rgb=None, allowGUI=True, monitor='testMonitor', units='deg', fullscr=True, screen=2)
def pol_to_cart(distance, angle, x_origin=0, y_origin=0):
x=distance*math.cos(math.radians(angle))
y=distance*math.sin(math.radians(angle))
return x +x_origin, y + y_origin
zdots = 4
zdot_list = []
j=(-8)
for i in range(zdots):
angle=0
line_cart = pol_to_cart(j, angle)
dotx = line_cart[0]
doty = line_cart[1]
zdot_list.append([dotx, doty])
j += .2
linea = visual.Line(win, start=(zdot_list[0]), end=(4,0), lineColor="white")
lineb = visual.Line(win, start=(zdot_list[1]), end=(4,0), lineColor="white")
linec = visual.Line(win, start=(zdot_list[2]), end=(4,0), lineColor="white")
lined = visual.Line(win, start=(zdot_list[3]), end=(4,0), lineColor="white")
lines = [linea, lineb, linec, lined]
for line in lines:
line.draw()
win.flip()
core.wait(3)
win.close()
( ) ? , xy "" . 4 , 80+, xy.
Cheers,