Trigonometric Expressions
sin(xy)=cos(xy)
sin(x)^y = x siny
\cos(x)+\sin(x*y)=\cos(y*x)+\sin(y)
\sin y=\cos x
Algebraic Equations
x!!=y!!
\log_{x}(y)=1/(\log_{y}(x))
math)
Sometimes the calculator detects that an equation is too complicated to plot perfectly in a reasonable amount of time. When this happens, the equation is plotted at lower resolution. The result can be quite intriguing
sin(xy)=cos(xy)
sin(x)^y = x siny
\cos(x)+\sin(x*y)=\cos(y*x)+\sin(y)
\sin y=\cos x
x!!=y!!
\log_{x}(y)=1/(\log_{y}(x))
#define _USE_MATH_DEFINES #include <math.h> #include <iostream> #include <iomanip> /** * Estimate PI using Leibiniz series * 1 - (1/3) + (1/5) - (1/7) + (1/9) .... = (pi / 4) */ void calc(int terms) { long double pi = M_PI; long double sum = 0; long long int denom = 1; for(int i = 0; i < terms; i++) { sum += pow(-1, i) * ( 1 / double(denom) ); denom += 2; long double estimate = sum * 4; long double diff = abs(pi - estimate); std::cout ...
Using FLTK graphics library to draw an arrow.
Aim - Create a C++ program to draw an arrow:
Given:
(x1, y1)
and end point (x2, y2).
Eg: (2, 3) and (10, 100)
x : y
. Eg 1:10
θ
. Eg: θ=67
Attempt 1 relies on individually calculating the slope of all 3 lines and finding points of the arrow by combining equations of distance formula
, tangent slope
for...
STL List Implementation
$ ./a.exe 500000 std::list: 5359224 ms list: 5368370 ms $ ./a.exe 200000 std::list: 536497 ms list: 487405 ms