help arcgraphfunctions (GitHub)

arc

: A program for generating arcs between two points.

The program inputs two pairs of coordinates (x1, y1) and (x2, y2) and outputs points for the arc segment in variables _x, _y.
The program is r-class so type return list after running the command to see the stored locals.

Syntax

arc, x1(num) y1(num) x2(num) y2(num) [ radius(num) n(int) swap major genx(newvar) geny(newvar) genid(string) genorder(string) replace ]

arc, x1() y1() x2() y2() Input two coordinate pairs.

radius(num) Specify the radius length. Must be at least equal to half the chord length. Stored in local r(chord). Default is the chord length.

n(int) Number of points to generate for each arc. Default is n(80), Must be great or equal to 5.

swap Swap the arc side. Arcs are, by default, oriented to the right of the line starting at (x1, y1) and ending at (x2, y2).
Or the arc circumcenter is to the left of the line.

major Draw a major arc around the circumcenter rather than the default minor arc.

genx(newvar) geny(newvar) Custom names for the generated coordinates. Defaults are _x, _y.

genorder(newvar) Custom name for the _order variable.

genid(newvar) Custom name for the _id variable.

replace Overwrite the generated variables if they exist. Use carefully.

Examples

Generate data:
clear
arc, y1(-2) x1(-4) y2(4) x2(2) rad(6)
return list
twoway (scatteri -2 -4) (scatteri 4 2) (scatteri `r(ycirc)' `r(xcirc)') (line _y _x), legend(order(1 "Point 1" 2 "Point 2" 3 "Circumcenter" 4 "Arc") pos(6) row(1)) xlabel(-10(2)10) ylabel(-10(2)10) aspect(1) xsize(1) ysize(1)

More examples on GitHub.

Package details

Version : arc v1.2 in graphfunctions
This release : 20 Nov 2024
First release: 08 Oct 2024
Repository : GitHub
Keywords : Stata, graph, arcs
License : MIT

Author : Asjad Naqvi
E-mail : asjadnaqvi@gmail.com
Twitter/X : @AsjadNaqvi

Feedback

Please submit bugs, errors, feature requests on GitHub by opening a new issue.

Citation guidelines

See graphfunctions.

Other packages

arcplot, alluvial, bimap, bumparea, bumpline, circlebar, circlepack, clipgeo, delaunay, graphfunctions, joyplot,
marimekko, polarspike, sankey, schemepack, spider, splinefit, streamplot, sunburst, ternary, treecluster, treemap, trimap, waffle

or visit GitHub.