
Добавил:
Studfiles2
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:Курсовая по ООП2 / prj4 / Ellipse
.cpp// Ellipse.cpp: implementation of the Ellipse class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "Ellipse.h"
#include <math.h>
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
Ellipse::Ellipse(double a, double b) : Curve (a, b) // Вызываем конструктор предка
{
}
double Ellipse::get(double x)
{
return sqrt((1 - x * x / a * a) * b * b); // x^2/a^2+y^2/b^2 = 1 => y=sqrt((1-x^2/a^2)*b^2)
}