Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

LABORATORY ASSIGNMENT 8 Dr. Duncan, CSC 1350, Louisiana State University 11/09/2017 Implementing an Ellipse Class Implement a basic Ellipse2D class whose objects represent an ellipse

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

LABORATORY ASSIGNMENT 8 Dr. Duncan, CSC 1350, Louisiana State University 11/09/2017 Implementing an Ellipse Class Implement a basic Ellipse2D class whose objects represent an ellipse in a plane Definition: An ellipse is a shape containing two interior points, the foci, such that the sum of the distances from any point on its perimeter to the foci is constant. See Figure 1 The area and perimeter of an ellipse can be calculated using the formulas below. perimeter 3(width + height)-M3 uidth + height) (width + 3 height) width (x.y) height Figure 1: A Visual Depiction of an Ellipse The Ellipse2D Class The Elipse2D class should have x, y, width and height, all doubles, as private instance variables of an Ellipse2D object. The X and Y-coordinates represent the top left corner of the bounding box of the ellipse, also referred to as its location. The widtth is its horizontal diameter and the height is its vertical diameter, both of which intersect at the center of the ellipse. The screern and cartesian coordinate systems are different: the Y-coordinates increase downward and decrease upward on the screen. This exercise assumes screen coordinates. Assignment N2 8 Page 1 The class should include the following constructors: public EMipse2DO: creates an ellipse located at (0,0) whose width and height are both 0. public Ellipse2D (double xLoc, double yLoc, double w, double h): creates an ellipse from the specified coordinates, where rLoc and yLoc are its location and w and h are its width and height respectively The class should have the following instance (accessor and mutator) methods: public double getHeight): returns the height of the framing rectangle in double precision. public double getWidth(): returns the width of the framing rectangle in double precision public double getX): returns the X-coordinate of the upper-left corner of the framing rect- angle in double precision. .public double getYO: retums the Y-coordinate of the upper-left corner of the framing rect- angle in double precision

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Temple Of Django Database Performance

Authors: Andrew Brookins

1st Edition

1734303700, 978-1734303704

More Books

Students also viewed these Databases questions

Question

Q.1. Taxonomic classification of peafowl, Tiger and cow ?

Answered: 1 week ago

Question

Q .1. Different ways of testing the present adulterants ?

Answered: 1 week ago

Question

Q.1. Health issues caused by adulteration data ?

Answered: 1 week ago

Question

=+4 What are non-union workers representations?

Answered: 1 week ago