aboutsummaryrefslogtreecommitdiffstats
path: root/demo.c
diff options
context:
space:
mode:
Diffstat (limited to 'demo.c')
-rw-r--r--demo.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/demo.c b/demo.c
index 76473e7..6157fbd 100644
--- a/demo.c
+++ b/demo.c
@@ -26,11 +26,16 @@ main(void)
{35, 15},
{20, 25},
{5, 15}
-#else
+#elif 0
{5.25, 5.25},
{35.75, 5.25},
{35.75, 25.75},
{5.25, 25.75}
+#else
+ /* for circular arch*/
+ {20, 15},
+ {15, 10},
+ {100 * M_PI/180, 400 * M_PI/180}
#endif
};
@@ -46,9 +51,21 @@ main(void)
#elif 0
rtgrpblib_draw_quadratic_bezier(raster, P(2), P(3), P(0));
rtgrpblib_draw_linear_bezier(raster, P(0), P(2));
-#else
+#elif 0
rtgrpblib_draw_cubic_bezier(raster, P(0), P(1), P(2), P(3));
rtgrpblib_draw_linear_bezier(raster, P(3), P(0));
+#else
+ rtgrpblib_draw_circular_arc(raster, P(0), P(1), P(2));
+ rtgrpblib_draw_linear_bezier(raster,
+ points[0].x + points[1].x * cos(points[2].y),
+ points[0].y + points[1].y * sin(points[2].y),
+ points[0].x,
+ points[0].y);
+ rtgrpblib_draw_linear_bezier(raster,
+ points[0].x,
+ points[0].y,
+ points[0].x + points[1].x * cos(points[2].x),
+ points[0].y + points[1].y * sin(points[2].x));
#endif
rtgrpblib_fill_shapes(image, width, raster);