@@ -15,6 +15,7 @@ void plot_ul(const double x0, const double y0, const double width, const double
15
15
void threecentredarch (const double xc , const double y0 , const double yc , const double d , const double r );
16
16
void half_ellipse (const double x0 , const double y0 , const double a , const double b , const double theta );
17
17
void plot_lr (const double x0 , const double y0 , const double width , const double height , const double r1 , const double r2 );
18
+ void pointedarch (const double xc , const double y0 , const double yc , const double d1 , const double d2 );
18
19
19
20
20
21
int main (int argc , char * const argv [])
@@ -89,7 +90,6 @@ void plot_ur(const double x0, const double y0, const double width, const double
89
90
90
91
/* Thicker pen for outline of arch */
91
92
// pencolr(1);
92
- // printf("VS5;\n");
93
93
94
94
circulararch (xc , y0 , yc , r2 );
95
95
circulararch (xc , y0 , yc , r2 * 1.15 );
@@ -153,7 +153,6 @@ void plot_ul(const double x0, const double y0, const double width, const double
153
153
154
154
/* Thicker pen for outline of arch */
155
155
// pencolr(1);
156
- // printf("VS5;\n");
157
156
158
157
threecentredarch (xc , y0 , yc , r3 , r4 );
159
158
threecentredarch (xc , y0 , yc , r3 , r4 * 1.3 );
@@ -190,7 +189,6 @@ void plot_ll(const double x0, const double y0, const double width, const double
190
189
191
190
/* Thicker pen for outline of arch */
192
191
// pencolr(1);
193
- // printf("VS5;\n");
194
192
195
193
ellipticalarch (xc , y0 , yc , r1 , r2 );
196
194
ellipticalarch (xc , y0 , yc , r1 + thickness , r2 + thickness );
@@ -233,4 +231,40 @@ void half_ellipse(const double x0, const double y0, const double a, const double
233
231
234
232
void plot_lr (const double x0 , const double y0 , const double width , const double height , const double r1 , const double r2 )
235
233
{
234
+ const double xc = x0 + (width / 2.0 );
235
+ const double yc = y0 + (height / 2.0 );
236
+ const double d = r2 / 2.0 ;
237
+ const double thickness = r2 / 10.0 ;
238
+
239
+ /* Centre lines */
240
+ moveto (x0 , yc );
241
+ lineto (x0 + width , yc );
242
+ moveto (xc , y0 );
243
+ lineto (xc , y0 + height );
244
+
245
+ /* Left-hand quarter-circle */
246
+ moveto (xc - d , yc );
247
+ arc (xc + d , yc , -90.0 );
248
+
249
+ /* Right-hand quarter-circle */
250
+ moveto (xc + d , yc );
251
+ arc (xc - d , yc , 90.0 );
252
+
253
+ /* Thicker pen for outline of arch */
254
+ // pencolr(1);
255
+
256
+ pointedarch (xc , y0 , yc , d , d );
257
+ pointedarch (xc , y0 , yc , d + thickness , d + thickness );
258
+ }
259
+
260
+
261
+ void pointedarch (const double xc , const double y0 , const double yc , const double d1 , const double d2 )
262
+ {
263
+ const double degrees = acos (d2 / (d1 + d2 )) * (180.0 / M_PI );
264
+
265
+ moveto (xc - d1 , y0 );
266
+ lineto (xc - d1 , yc );
267
+ arc (xc + d2 , yc , - degrees );
268
+ arc (xc - d2 , yc , - degrees );
269
+ lineto (xc + d1 , y0 );
236
270
}
0 commit comments