2 #include "../../constant.h" 10 double xCursorPosition = cursor->
x();
11 double x = direction > 0 ? xCursorPosition + range->
xGridUnit()/numberOfStepsInGradUnit : xCursorPosition - range->
xGridUnit()/numberOfStepsInGradUnit;
12 double y =
function->evaluateAtAbscissa(x, app->
localContext());
14 range->
panToMakePointVisible(x, y, cursorTopMarginRatio, cursorRightMarginRatio, cursorBottomMarginRatio, cursorLeftMarginRatio);
20 const char * space =
" ";
21 int spaceLength =
strlen(space);
22 const char * legend =
"00(x)=";
23 int legendLength =
strlen(legend);
24 int numberOfChar =
strlcpy(buffer, legend, legendLength+1);
25 buffer[0] =
function->name()[0];
27 double y =
function->approximateDerivative(cursor->
x(), app->
localContext());
29 strlcpy(buffer+numberOfChar, space, spaceLength+1);
30 buffer[k_maxDigitLegendLength+6] = 0;
31 bannerView()->setLegendAtIndex(buffer, 2);
size_t strlcpy(char *dst, const char *src, size_t len)
static constexpr int k_maxNumberOfCharacters
float xGridUnit() override
static constexpr int ShortNumberOfSignificantDigits
virtual Poincare::Context * localContext()
size_t strlen(const char *s)
static constexpr int LargeNumberOfSignificantDigits
void moveTo(double x, double y)
void panToMakePointVisible(float x, float y, float topMarginRatio, float rightMarginRatio, float bottomMarginRation, float leftMarginRation)