Hello again!

I'm having trouble trying to double the value of my coordinates in my point. The object is to create a pair of eyes and their position is identified by clicking a point in the graphic window which would allocated the centre of the left eye, and the second click would identify the radius of the circle by clicking the edge of its circumference. The third eye is placed directly beside it, so I figured I had to make the coordinates of the right eye's centre twice as long as the left eye's centre.

I've tried so many arithmetic ways to alter my point's value but I just can't get anything to work!

def drawBrownEye(win, centre, radius):
    circle = drawCircle(win, centre, radius, "white")
    circle = drawCircle(win, centre, radius / 2, "brown")
    circle = drawCircle(win, centre, radius / 5, "black")

def distanceBetweenPoints(p1, p2):
    return math.sqrt((p1.getX()-p2.getX())**2 + (p1.getY()-p2.getY())**2)

def drawFourPairsOfBrownEyes():
    win = GraphWin("Drawing Four Pairs of Eyes", 500, 500)
    for i in range(4):
        p1 = win.getMouse()
        p2 = win.getMouse()
        radius = distanceBetweenPoints(p1, p2)
        leye = drawBrownEye(win, p1, radius)
        reye = drawBrownEye(win, p1, radius)

Solved! Messaged my tutor; he said I had to create variables with the values of where I want my coordinates. used this code:

x = p1.getX()
y = p1.getY()
x = x + radius*2
newp = Point(x,y)
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.