conecurveface.java

来自「基于面向对象的数据库编程」· Java 代码 · 共 68 行

JAVA
68
字号
package brgeometry;

/**
 * <p>Title: Broundary Rrepresentaion</p>
 * <p>Description: 这是一个椎面</p>
 * <p>Copyright: Copyright (c) 2003</p>
 * <p>Company: USTC</p>
 * @author unascribed
 * @version 1.0
 */

public class ConeCurveFace
    extends CurveFace {

  private BeelineEdge high;
  private RoundCurveEdge hemline; //底边
 // public double area;
  public ConeCurveFace(RoundCurveEdge hemline, BeelineEdge high) {
    this.hemline = hemline;
    this.high = high;
   this.setarea(this.getarea());
  }

  public ConeCurveFace() {

  }

  //有关属性的操作

  public void setHigh(BeelineEdge high) {
    this.high = high;
  }

  public void setHemline(RoundCurveEdge hemline) {
    this.hemline = hemline;
  }

  public BeelineEdge gethigh() {
    return this.high;

  }

  public RoundCurveEdge gethemline() {
    return this.hemline;
  }

  //取得面积,实现
  public double getRadius() {
    return hemline.getRadius();
  }

  public double getHith() {
    return high.getLength();
  }

  public double getarea() {
    double h = high.getLength();
    double r = hemline.getRadius();
    return 3.1415926 * r * Math.sqrt(h * h + r * r);
  }

  private void translate() {}

  private void scale() {}

  private void rotate() {}

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?