mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
30 lines
503 B
C++
30 lines
503 B
C++
#include "trigonometry_model.h"
|
|
|
|
namespace Calculation {
|
|
|
|
TrigonometryModel::TrigonometryModel() :
|
|
Shared::CurveViewRange(),
|
|
m_angle(NAN)
|
|
{
|
|
}
|
|
|
|
float TrigonometryModel::yMin() const {
|
|
if (m_shouldDisplayTan) {
|
|
return -1.1f;
|
|
}
|
|
return yCenter() - yHalfRange();
|
|
}
|
|
|
|
float TrigonometryModel::yMax() const {
|
|
if (m_shouldDisplayTan) {
|
|
float t = std::tan(angle());
|
|
if (t <= 1.2f) {
|
|
return 1.2f;
|
|
}
|
|
return 1.2f * std::tan(angle());
|
|
}
|
|
return yCenter() + yHalfRange();
|
|
}
|
|
|
|
}
|