## ellipse.api
#
# Code for producing rotated and translated
# ellipses as a list of (row,col) points.
# Compiled by:
#
src/lib/x-kit/draw/xkit-draw.sublib# Based on an ellipse generator, written by James Tough, 7th May 92
stipulate
package g2d= geometry2d; # geometry2d is from
src/lib/std/2d/geometry2d.pkgherein
api Ellipse {
exception BAD_AXIS;
ellipse: (g2d::Point, Int, Int, Float) -> List( g2d::Point );
#
# ellipse (center, a /*radius_x*/, b /*radius_y*/, phi) produces a list of points
# describing the ellipse
#
# x**2 y**2
# ---- + ---- = 1
# a**2 b**2
#
# translated to point 'center' and rotated 'phi' radians
# counterclockwise. If a == 0 or b == 0, it returns [].
# Raises BAD_AXIS if a < 0 or b < 0.
};
end;
## COPYRIGHT (c) 1992 by AT&T Bell Laboratories
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2015,
## released per terms of SMLNJ-COPYRIGHT.