MCPcopy Create free account
hub / github.com/GenericMappingTools/gmt / gmtplot_northstar

Function gmtplot_northstar

src/gmt_plot.c:3313–3344  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3311}
3312
3313GMT_LOCAL void gmtplot_northstar (struct GMT_CTRL *GMT, struct PSL_CTRL *PSL, double x0, double y0, double r) {
3314 /* Draw a fancy 5-pointed North star */
3315 unsigned int a;
3316 double r2, x[4], y[4], dir, dir2, s, c;
3317
3318 r2 = r * 0.3;
3319 for (a = 0; a <= 360; a += 72) { /* Azimuth of the 5 points on the star */
3320 /* Solid half */
3321 x[0] = x[3] = x0, y[0] = y[3] = y0;
3322 dir = 90.0 - (double)a;
3323 sincosd (dir, &s, &c);
3324 x[1] = x0 + r * c;
3325 y[1] = y0 + r * s;
3326 dir2 = dir - 36.0;
3327 sincosd (dir2, &s, &c);
3328 x[2] = x0 + r2 * c;
3329 y[2] = y0 + r2 * s;
3330 PSL_setfill (PSL, GMT->current.setting.map_default_pen.rgb, 1);
3331 PSL_plotpolygon (PSL, x, y, 4);
3332 /* Hollow half */
3333 x[0] = x[3] = x0, y[0] = y[3] = y0;
3334 sincosd (dir, &s, &c);
3335 x[1] = x0 + r * c;
3336 y[1] = y0 + r * s;
3337 dir2 = dir + 36.0;
3338 sincosd (dir2, &s, &c);
3339 x[2] = x0 + r2 * c;
3340 y[2] = y0 + r2 * s;
3341 PSL_setfill (PSL, GMT->PSL->init.page_rgb, 1);
3342 PSL_plotpolygon (PSL, x, y, 4);
3343 }
3344}
3345
3346#define M_VW 0.005
3347#define M_HL 0.075

Callers 1

gmtplot_draw_mag_roseFunction · 0.85

Calls 2

PSL_setfillFunction · 0.85
PSL_plotpolygonFunction · 0.85

Tested by

no test coverage detected