The function itself seems fine. I got it to draw a series of dots the way I expected:
SetVirtualResolution(640,480)
x1# = 50
y1# = 360
x2# = 590
y2# = 120
spr = createSprite(0)
setSpriteColor(spr,255,0,0,255)
setSpriteSize(spr,8,8)
setSpriteOffset(spr,4,4)
setSpriteAngle(spr,45)
setSpritePositionByOffset(spr,x1#,y1#)
spr = createSprite(0)
setSpriteColor(spr,255,0,0,255)
setSpriteSize(spr,8,8)
setSpriteOffset(spr,4,4)
setSpriteAngle(spr,45)
setSpritePositionByOffset(spr,x2#,y2#)
for x=1 to 9
spr = createSprite(0)
setSpriteColor(spr,255,255,0,255)
setSpriteSize(spr,4,4)
setSpriteOffset(spr,2,2)
setSpriteAngle(spr,45)
mu# = x*0.1
setSpritePositionByOffset(spr,50+x*(x2#-x1#)*0.1,LinearInterpolation(y1#,y2#,mu#))
next
Do
If GetRawKeyPressed(32) = 1 Then End
Print("Press Space To End")
Sync()
Loop
Function LinearInterpolation(y1#,y2#,mu#)
result# = y1#*(1-mu#)+y2#*mu#
EndFunction result#
I couldn't quite understand what you were trying to do with your own code though so I couldn't help.
Maybe if you could explain better?