We are about to switch to a new forum software. Until then we have removed the registration on this forum.
i have seen many un-processonic codes for dealing with pointing towards mouse including the use of atan and PVector here is a natural solution :
def setup():
size(640, 640)
def draw():
background(255)
translate(width/2, height/2)
location = PVector(200, 200)
mouse = PVector(mouseX, mouseY)
mouse.sub(location) # vector from mouse to point
mouse.normalize()
mouse.mult(50)
line(0, 0, mouse.x, mouse.y)
Comments
more info: here