diff options
author | Mattias Andrée <maandree@kth.se> | 2023-02-05 09:31:10 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2023-02-05 09:31:10 +0100 |
commit | bd0bed7feb76a87148fb62e4c3cd19c862a2b01f (patch) | |
tree | 52e6c7ddd5ee037cd157e5029494ea4200c08ee4 /demo.c | |
parent | First commit (diff) | |
download | librifunktionsteckensnittsglyfrasteriseringsprogrambiblioteket-bd0bed7feb76a87148fb62e4c3cd19c862a2b01f.tar.gz librifunktionsteckensnittsglyfrasteriseringsprogrambiblioteket-bd0bed7feb76a87148fb62e4c3cd19c862a2b01f.tar.bz2 librifunktionsteckensnittsglyfrasteriseringsprogrambiblioteket-bd0bed7feb76a87148fb62e4c3cd19c862a2b01f.tar.xz |
Add rtgrpblib_draw_circular_arc
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r-- | demo.c | 21 |
1 files changed, 19 insertions, 2 deletions
@@ -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); |