Anonymous user
Bitmap/Bézier curves/Quadratic: Difference between revisions
→{{header|MiniScript}}
imported>Chinhouse No edit summary |
imported>Chinhouse |
||
Line 1,345:
end function
▲Img.line = function(x0, y0, x1, y1, colr)
sign = function(a, b)
if a < b then return 1
Line 1,375 ⟶ 1,365:
while true
if x0 == x1 and y0 == y1 then break
e2 = err
Line 1,387 ⟶ 1,377:
end if
end while
end function
points = []
for i in range(0, numPoints)
Line 1,402 ⟶ 1,391:
y = floor(a * p1.y + b * p2.y + c * p3.y)
points.push(Point.init(x, y))
end for
for i in range(1, numPoints)
end for
end function
p1 = Point.init(50, 100)
p2 = Point.init(200, 400)
p3 = Point.init(360, 55)
gfx.clear
gfx.drawImage
</syntaxhighlight>
|