代码拉取完成,页面将自动刷新
#pragma once
#include "testing.h"
const double PI = 3.1415926535897932384626433832795028842;
// forward declarations, allows references
// to be used between the different classes
class Circle;
class PolarPoint;
class CartesianPoint;
class Circle {
public:
double radius;
double area();
double circumference();
};
class CartesianPoint {
public:
double x;
double y;
double distanceTo(const CartesianPoint& x) const;
double distanceTo(const PolarPoint& x) const;
};
class PolarPoint {
public:
double r;
double theta;
};
/**
* Computes the area of a circle
*/
double areaOfCircle(double r);
/**
* Computes the circumference of a circle
*/
double circumferenceOfCircle(double r);
/**
* Converts Cartesian coordinates to polar coordinates. Note this
* changes r and theta.
*/
PolarPoint cartesianToPolar(const CartesianPoint&);
/**
* Converts polar coordinates to cartesian. Note, this changes x and y.
*/
CartesianPoint polarToCartesian(const PolarPoint&);
/**
* Computes the perimeter of a triangle
*/
double perimeter(const CartesianPoint& p1,
const CartesianPoint& p2,
const CartesianPoint& p3);
/**
* Test suite
*/
void testGeometry();
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。