Anonymous user
Bitmap/Bézier curves/Cubic: Difference between revisions
Using Real Math module
(Added solution for Action!) |
(Using Real Math module) |
||
Line 124:
{{libheader|Action! Bitmap tools}}
{{libheader|Action! Tool Kit}}
{{libheader|Action! Real Math}}
<lang Action!>INCLUDE "H6:RGBLINE.ACT" ;from task Bresenham's line algorithm
INCLUDE "
RGB black,yellow,violet,blue
TYPE IntPoint=[INT x,y]
PROC CubicBezier(RgbImage POINTER img
Line 188 ⟶ 173:
RealMult(rd,x4,tmp1) ;tmp1=d*x4
RealAdd(tmp2,tmp1,tmp3) ;tmp3=a*x1+b*x2+c*x3+d*x4
nextX=
RealMult(ra,y1,tmp1) ;tmp1=a*y1
Line 197 ⟶ 182:
RealMult(rd,y4,tmp1) ;tmp1=d*y4
RealAdd(tmp2,tmp1,tmp3) ;tmp3=a*y1+b*y2+c*y3+d*y4
nextY=
IF i>0 THEN
|