Пример #1
0
void Graph::setYAxisScale(double min, double max, bool keepRatio)
{
  setAxisScale(yLeft,min,max);
  setAxisScale(yRight,min,max);
  if (keepRatio)
  {
    double dx = getXEnd() - getXStart();
    double dy = getYEnd() - getYStart();
    double ratio = dy / dx;
    dy = max - min;
    dx = dy / ratio / 2;
    double x = (getXEnd() + getXStart()) / 2;
    setXAxisScale(x - dx, x + dx, false);
  }
}
Пример #2
0
void Graph::setXAxisScale(double min, double max, bool keepRatio)
{
  setAxisScale(xBottom,min,max);
  setAxisScale(xTop,min,max);
  if (keepRatio)
  {
    double dx = getXEnd() - getXStart();
    double dy = getYEnd() - getYStart();
    double ratio = dy / dx;
    dx = max - min;
    dy = dx * ratio / 2;
    double y = (getYEnd() + getYStart()) / 2;
    setXAxisScale(y - dy, y + dy, false);
  }
} 
Пример #3
0
double AlnusPhyolgeticBranch::getXChild() const
{
    return getXEnd();
}