!   TITLE:  elliptic_arcs.mac (SM_TOOL)
!
!
!   OBJECTIVE:
!
!   This sub-macro creates a set of elliptically arced lines between 2
!   specified points. (This is used in conjunction with ANVIL)
!
!
!   COMMAND SYNTAX:
!
!                      (1) (2)  (3)    (4)      (5)        (6)     (7) (8)
!       ELLIPTIC_ARCS, CS, X_c, Y_c, rot_XY, X_ax_dist, Y_ax_dist, K1, K2
!
!
!   ARGUMENTS:
!
!       (1) CS = coordinate system (CS) to create elliptic CS relative to.
!
!       (2) X_c = X coordinate of the elliptic CS center.
!
!       (3) Y_c = Y coordinate of the elliptic CS center.
!
!       (4) rot_XY = XY rotation angle of the axes of the elliptic CS.
!
!       (5) X_ax_dist = distance along X axis of the semi-major/minor
!                       elliptic radius.
!
!       (6) Y_ax_dist = distance along Y axis of the semi-major/minor
!                       elliptic radius.
!
!       (7) K1 = keypoint number of 1st end of the arc.
!
!       (8) K2 = keypoint number of 2nd end of the arc.
!
!       (9) N_arcs = number of arcs within points K1 and K2.
!
!
!   DESCRIPTION:
!
!   Creates a partial ellipse of arcs between 2 endpoints. The ellipse center
!   is located at the X and Y coordinates (relative to the CS specified in
!   argument 1) at an angular orientation (argument 4) as specified in
!   arguments 1, 2, 3 and 4.
!
!   The ratio of the Y/X axes aspect ratio of the ellipse radii is calculated
!   from arguments 5 and 6.
!
!   All coordinate positions, points and lines are formed in the XY plane of
!   the main CS specified in argument 1.
!
!
!
*get,prkey_,active,0,prkey
/nopr
!
configuration,0
init_entity_num
!
cs__=arg1
xc__=arg2
yc__=arg3
rotxy__=arg4
xradd__=arg5
yradd__=arg6
k1__=arg7
k2__=arg8
narcs__=arg9
!
*if,xradd__,eq,0,then
    ratio__=1
*else
    ratio__=yradd__/xradd__
*endif
!
csys,cs__
create_cs,0,,0
!
create_cs,0,,1,xc__,yc__,0,rotxy__,0,0
!
!
!                    (1)    (2)     (3)     (4)    (5)      (6)       (7)
!     CREATE_ARCS, radius, z_loc, ang_inc, n_arc, st_ang, fin_ang, ratio_y/x
!
!
create_arcs,kx(k1__),,,narcs__,ky(k1__),ky(k2__),ratio__
!
configuration,1
init_entity_num
!
lplot
!
*set,rad_,
*set,zloc_,
*set,anginc_,
*set,narc_,
*set,stang_,
*set,finang_,
*set,ii_,
*set,ang_,
*set,ratyx__,
!
*if,prkey_,eq,1,then
    /go
*endif