Java代写|MA117 Project 1: Circles on a Plane


1 Formulation of the Problem

This assignment focuses neither on mathematical/modelling issues nor on any advanced techniques in scientific computing. It will test your ability to write a simple Java code consisting of a few classes and manipulate simple data structures. Remember that marks are available for properly documenting and structuring your code.

You are given a set of data stored in a text (ASCII) file. Each line in this file stores 3 real numbers that represent:

• the coordinates (?, ?) of a point in the plane and
• a radius ? of the circle with the centre at that point.

Hence each line in the file represents a circle in the plane. Your task is to write a code which will analyse this set of circles. The number of lines in the file is 40 ≤ ????? ≤ 5000. The statistical analysis required in this step is very simple and does not require any sophisticated techniques. The information you want to extract from this set of data is:

1. The number of circles in the set. When reading the description of circles from the file you will need to ignore those circles which are “singular”, i.e., those for which the radius is equal to zero, within a certain tolerance (described below). However, you will not need to check whether two circles might be identical. Also, you may assume that the data in the file are in a proper format, so you do not need to perform any additional checks to, for example, check for an incorrect number of points per line.

2. The largest (?max) and the smallest (????) area of a circle in the file.

3. The average area of a circle, ? = 1?∑? ?=1 ?? (where ??is the area of the ?th non-singular circle in the data file).

4. The standard deviation of area; i.e., compute

5. The median of the areas; i.e. the value ? such that, if the areas are ordered in ascending order, half of them are larger than ?, and the other half are smaller. If there is an even number of values in the set, then the median is usually defined as the average of the two elements in the middle. For example,the median of the set {1,7,3,5,3} is 3, and the median of {1,2,6,5} is 3.5.

6. A single axis-aligned bounding rectangle around the tenth (non-singular) and twentieth (non-singular) circle in the set of data. The rectangle should be reported as 4 values: ?1, ?1, ?2, ?2. The origin (?1, ?1) is the position of the rectangle’s bottom left corner. The rectangle’s sides will touch the edges of the circles such that: