2017-10-10 9 views

答えて

1

Rectangle自分自身の左下隅で位置(X座標とY座標)を定義します。

しかし、Circleの場合、コーナーやそのようなパラメータはありません。中心(XとY座標)と半径を持つ円。

我々はこの場合にはデフォルトコンストラクタ

Circle circle=new Circle();  

の円を構築する場合は円の中心は、左下画面の半径がゼロの時になるようにX、全てのY及び半径は、ゼロです。

1

円のX/Y座標が中心です。

ここはサークルの建築家の一人です。

/** Constructs a new circle with the given X and Y coordinates and the given radius. 
* 
* @param x X coordinate 
* @param y Y coordinate 
* @param radius The radius of the circle */ 
public Circle (float x, float y, float radius) { 
    this.x = x; 
    this.y = y; 
    this.radius = radius; 
} 
関連する問題