Update
This commit is contained in:
parent
dcb8228ac1
commit
69630c448e
5 changed files with 2033 additions and 1900 deletions
174
calculus.md
174
calculus.md
|
@ -17,7 +17,38 @@ One thing shows here: one of the reasons why calculus is considered advanced is
|
||||||
|
|
||||||
Now listen up, here comes the truth about calculus. Doing it correctly and precisely is difficult and sometimes literally impossible, and this is left for mathematicians. Programmers and engineers HAVE TO know the basic theory, but we are largely saved by one excellent thing: **[numerical](numerical.md) methods**. We can compute derivatives and integrals only [approximately](approximation.md) with algorithms that always work for any function and which will be [good enough](good_enough.md) for almost everything we ever encounter in practice. Besides in [digital](digital.md) computers we deal almost exclusively with non-continuous functions anyway, we just have very dense discrete sets of points because in the end we only have finite memory, integer values and sampled data, so there is nothing more natural than numerical methods here. So where a mathematician spends years trying to figure out how to precisely sum up infinitely many infinitely small parts of some weird function, we just write a program that sums up a very big number of very tiny parts and call it a day. Still there exist programs for so called *symbolic computation* that try to automatically do what the mathematician does, i.e. apply reasoning to get precise results, but these belong to some quite specialized areas.
|
Now listen up, here comes the truth about calculus. Doing it correctly and precisely is difficult and sometimes literally impossible, and this is left for mathematicians. Programmers and engineers HAVE TO know the basic theory, but we are largely saved by one excellent thing: **[numerical](numerical.md) methods**. We can compute derivatives and integrals only [approximately](approximation.md) with algorithms that always work for any function and which will be [good enough](good_enough.md) for almost everything we ever encounter in practice. Besides in [digital](digital.md) computers we deal almost exclusively with non-continuous functions anyway, we just have very dense discrete sets of points because in the end we only have finite memory, integer values and sampled data, so there is nothing more natural than numerical methods here. So where a mathematician spends years trying to figure out how to precisely sum up infinitely many infinitely small parts of some weird function, we just write a program that sums up a very big number of very tiny parts and call it a day. Still there exist programs for so called *symbolic computation* that try to automatically do what the mathematician does, i.e. apply reasoning to get precise results, but these belong to some quite specialized areas.
|
||||||
|
|
||||||
TODO: graph
|
```
|
||||||
|
xxx : ###
|
||||||
|
xx : ##
|
||||||
|
xx *** xxxxxxxxx
|
||||||
|
xx ***: ** xxx ##xxx
|
||||||
|
xx ** : *xx # xxx
|
||||||
|
xx ** : xx* # xx *
|
||||||
|
xx * :xx ** ## xxx x
|
||||||
|
xx * xx **## xxx xxx
|
||||||
|
x ** xx *# xxxxx*
|
||||||
|
x * xx: ##* *
|
||||||
|
xx * xx : ## ** *
|
||||||
|
xx * xx : ### * *
|
||||||
|
xxx * xxx : ## * *
|
||||||
|
xxxxxx ### ** *
|
||||||
|
----------------------*------####----------*--------------**----
|
||||||
|
########## : * *
|
||||||
|
* #### * : ** **
|
||||||
|
* ## ** : * **
|
||||||
|
* ## * : * *
|
||||||
|
** ## ** : * *
|
||||||
|
* ## * : *** **
|
||||||
|
* # ** : *****
|
||||||
|
** # * :
|
||||||
|
* # * :
|
||||||
|
## ** :
|
||||||
|
#** ** :
|
||||||
|
## ** * :
|
||||||
|
# ** ** :
|
||||||
|
```
|
||||||
|
|
||||||
|
*Graph showing a function (`x`), its derivative (`*`) and (one of) its integral(s) (`#`).*
|
||||||
|
|
||||||
## Derivative
|
## Derivative
|
||||||
|
|
||||||
|
@ -27,7 +58,7 @@ NOTE on notation: there are several notations used for derivatives. We will use
|
||||||
|
|
||||||
OK, BUT **what exactly IS this "derivative"? What does it say?** Basically derivative is the **tangent** to the graph of a function at given point. Derivative of function *f(x)* is a new function *f'(x)* which for given *x* says the **slope** of the graph of function *f(x)* at the point *x*. Slope here means literally the [tangent](tan.md) function which encodes the angle at which the function is increasing (or decreasing). Tangent is defined as the (unitless) ratio of vertical change to horizontal change (for example if a plane is ascending with tangent equal to 2, we know that for every horizontal meter it gains two meters of height). Note that this is mathematically idealized so that no matter how quickly the function changes we really mean the slope at the exact single point, i.e. imagine drawing a tangent line to the graph of the function and then measuring how quickly it changes vertically versus how quickly it changes horizontally. Mathematicians define this using [limits](limit.md) and infinitesimal intervals, but we don't have to care too much about that now, let's just assume it [magically](magic.md) all works now.
|
OK, BUT **what exactly IS this "derivative"? What does it say?** Basically derivative is the **tangent** to the graph of a function at given point. Derivative of function *f(x)* is a new function *f'(x)* which for given *x* says the **slope** of the graph of function *f(x)* at the point *x*. Slope here means literally the [tangent](tan.md) function which encodes the angle at which the function is increasing (or decreasing). Tangent is defined as the (unitless) ratio of vertical change to horizontal change (for example if a plane is ascending with tangent equal to 2, we know that for every horizontal meter it gains two meters of height). Note that this is mathematically idealized so that no matter how quickly the function changes we really mean the slope at the exact single point, i.e. imagine drawing a tangent line to the graph of the function and then measuring how quickly it changes vertically versus how quickly it changes horizontally. Mathematicians define this using [limits](limit.md) and infinitesimal intervals, but we don't have to care too much about that now, let's just assume it [magically](magic.md) all works now.
|
||||||
|
|
||||||
Here it is show graphically:
|
Here it is shown graphically:
|
||||||
|
|
||||||
```
|
```
|
||||||
tangent / __
|
tangent / __
|
||||||
|
@ -45,8 +76,7 @@ _-' /__|
|
||||||
A
|
A
|
||||||
```
|
```
|
||||||
|
|
||||||
Here we see a tangent line drawn at the graph of function *f(x)* at point *A*. We can draw the small right triangle and like shown -- the derivative at point *A* is now literally computed by dividing *dy* by *dx*. We can actually try to approximate the ideal derivative (and this is kind of how computers do it with the numerical methods) by computing
|
Here we see a tangent line drawn at the graph of function *f(x)* at point *A*. We can draw the small right triangle and like shown -- the derivative at point *A* is now literally computed by dividing *dy* by *dx*. We can actually try to approximate the ideal derivative (and this is kind of how computers do it with the numerical methods) by computing *(f(x + C) - f(x)) / C* where *C* we set to some small number, for example 10^-10. It's basically how it's mathematically defined too, mathematicians just set the *C* to "infinitely small distance". By this notice that the derivative will be:
|
||||||
*(f(x + C) - f(x)) / C* where *C* we set to some small number, for example 10^-10. It's basically how it's mathematically defined too, mathematicians just set the *C* to "infinitely small distance". By this notice the that the derivative will be:
|
|
||||||
|
|
||||||
- 0 if the function is monotonic (i.e. going "horizontally", neither increasing nor decreasing). This is because *dy* will be 0 and 0 divided by any *dx* will be 0. This fact is used especially when we're finding where functions have minimum and maximum values as we know at these extreme values they will be monotonic.
|
- 0 if the function is monotonic (i.e. going "horizontally", neither increasing nor decreasing). This is because *dy* will be 0 and 0 divided by any *dx* will be 0. This fact is used especially when we're finding where functions have minimum and maximum values as we know at these extreme values they will be monotonic.
|
||||||
- > 0 if the function is increasing. This is because *dy* will be positive and since *dx* is always positive, we'll get a positive number by dividing them.
|
- > 0 if the function is increasing. This is because *dy* will be positive and since *dx* is always positive, we'll get a positive number by dividing them.
|
||||||
|
@ -56,18 +86,18 @@ Now it's important to say that derivatives can only be done with **differentiabl
|
||||||
|
|
||||||
OK so to actually compute a derivative of a function we can use some of the following rules:
|
OK so to actually compute a derivative of a function we can use some of the following rules:
|
||||||
|
|
||||||
| *f(x)* | *f'(x)* |
|
| *f(x)* | *f'(x)* | comment |
|
||||||
| ---------------------- | ----------------------------- |
|
| ---------------------- | ----------------------------- | --------------- |
|
||||||
| *n* | *0* |
|
| *n* | *0* | additive const. |
|
||||||
| *x^n* | *n * x^(n-1)* |
|
| *x^n* | *n * x^(n-1)* | var. to power |
|
||||||
| *e^x* | *e^x* |
|
| *e^x* | *e^x* | |
|
||||||
| *sin(x)* | *cos(x)* |
|
| *sin(x)* | *cos(x)* | |
|
||||||
| *cos(x)* | *-sin(x)* |
|
| *cos(x)* | *-sin(x)* | |
|
||||||
| *ln(x)* | *1/x* |
|
| *ln(x)* | *1/x* | |
|
||||||
| *a * g(x)* | *a * g'(x)* |
|
| *a * g(x)* | *a * g'(x)* | |
|
||||||
| *g(x) + h(x)* | *g'(x) + h'(x)* |
|
| *g(x) + h(x)* | *g'(x) + h'(x)* | |
|
||||||
| *g(x) * h(x)* | *g'(x) * h(x) + g(x) * h'(x)* |
|
| *g(x) * h(x)* | *g'(x) * h(x) + g(x) * h'(x)* | |
|
||||||
| *g(h(x))* | *g'(h(x)) * h'(x)* |
|
| *g(h(x))* | *g'(h(x)) * h'(x)* | chain rule |
|
||||||
|
|
||||||
**Monkey example**: let's try to find the derivative of this super retarded function:
|
**Monkey example**: let's try to find the derivative of this super retarded function:
|
||||||
|
|
||||||
|
@ -140,7 +170,7 @@ As already claimed in the section on derivative, integrating is **more difficult
|
||||||
So due to these complications we now yet have to explain the two different types of integrals:
|
So due to these complications we now yet have to explain the two different types of integrals:
|
||||||
|
|
||||||
- **indefinite integral**: This is the FUNCTION we get by performing integration, i.e. result of indefinite integral is a mathematical expression with variables in it. In fact this expression represents an infinite set of functions because it always has the additive constant *C* in it (like hinted above) -- we can kind of ignore this for now. The important gist is this: indefinite integral kind of gives us a general FORMULA that can further be used to compute definite integrals. For example an indefinite integral of function *f(x) = 1* will be *x + C*. In practice the result we are searching is often a definite integral (a single value), but to compute that we have to start by computing the indefinite integral.
|
- **indefinite integral**: This is the FUNCTION we get by performing integration, i.e. result of indefinite integral is a mathematical expression with variables in it. In fact this expression represents an infinite set of functions because it always has the additive constant *C* in it (like hinted above) -- we can kind of ignore this for now. The important gist is this: indefinite integral kind of gives us a general FORMULA that can further be used to compute definite integrals. For example an indefinite integral of function *f(x) = 1* will be *x + C*. In practice the result we are searching is often a definite integral (a single value), but to compute that we have to start by computing the indefinite integral.
|
||||||
- **definite integral**: This is a single [NUMBER](number.md) which (applying the geometric interpretation of integral) tells us the AREA below the function graph (with area below zero counting as negative) over some specific INTERVAL, i.e. between two given points A and B. This means that definite integral doesn't give us an expression but rather a quantity. For example a definite integral of function *f(x) = 1* over interval [0,1] will give us 1 (imagine the graph: the area is simply that of a square with side 1). Definite integrals are computed from the indefinite integral by plugging the upper interval number into the indefinite integral (in the place of the variable), then plugging the lower interval number, and then subtracting the latter from the former. With numeric methods (computer integration) we always only get definite integrals (and actually only their approximate values) -- the computer here skips computing the indefinite integral (as that's hard) and rather like a dumb machine LITERALLY goes by small steps and computes the area below the function graph.
|
- **definite integral**: This is a single [NUMBER](number.md) which (applying the geometric interpretation of integral) tells us the AREA below the function graph (with area below zero counting as negative) over some specific INTERVAL, i.e. between two given points A and B. This means that definite integral doesn't give us an expression but rather a quantity. For example a definite integral of function *f(x) = 1* over interval [0,1] will give us 1 (imagine the graph: the area is simply that of a square with side 1). Definite integrals are computed from the indefinite integral by plugging the upper interval number into the indefinite integral (in the place of the variable), then plugging the lower interval number, and then subtracting the latter from the former. With numeric methods (computer integration) we always only get definite integrals (and actually only their approximate values) -- the computer here skips computing the indefinite integral (as that's hard) and rather like a dumb machine LITERALLY goes by small steps and computes the area below the function graph. Small note to this: the computer still can draw a graph of a function's integral by plotting definite integral value for interval 0 to *x* for every plotted *x* because when we think about it, the indefinite integral kind of gives us a function of how an indefinite integral grows; so the computer can give us a picture of a graph but it generally cannot give us an analytically computed formula of indefinite integral.
|
||||||
|
|
||||||
**Example**: we will now try to make an indefinite integral of the function:
|
**Example**: we will now try to make an indefinite integral of the function:
|
||||||
|
|
||||||
|
@ -150,28 +180,40 @@ This is the derivative we got in the example of differentiation, so by integrati
|
||||||
|
|
||||||
Now for the **notation**: the symbol for integral is kind of a big italic *S* ([Unicode](unicode.md) U+222), but for [simplicity](kiss.md) we will just use the uppercase letter *I* here. With indefinite integrals only the symbol alone is used. For definite integrals we additionally write the interval over which we make the integral, i.e. *I(A,B)* (normally *A* is written at the bottom and *B* at the top), where *A* and *B* says the interval. So we will now write our indefinite integral like this:
|
Now for the **notation**: the symbol for integral is kind of a big italic *S* ([Unicode](unicode.md) U+222), but for [simplicity](kiss.md) we will just use the uppercase letter *I* here. With indefinite integrals only the symbol alone is used. For definite integrals we additionally write the interval over which we make the integral, i.e. *I(A,B)* (normally *A* is written at the bottom and *B* at the top), where *A* and *B* says the interval. So we will now write our indefinite integral like this:
|
||||||
|
|
||||||
*I 2 * x - 2 dx*
|
*I (2 * x - 2) dx*
|
||||||
|
|
||||||
**Wait dude WHAT THE FUCK is this dx shit at the end?** This question is expected. Look: it has to do with the theory behind what the integral mathematically means, for starters one can just ignore it and remember that integral starts with *I*, then the integrated function follows, and then there is *dx* at the end. But to give a bit of explanation: firstly notice the *dx* tells us what the integrated variable is -- usually we have a function with single variable *x* and so it's pretty clear, but once we move to more dimensions we'll have more variables and this *dx* tells us what is a variable (i.e. along which axis we are integrating) and what is to be treated as a constant (maybe this doesn't yet make much sense but with integration there is a big difference between a variable and a constant, even if they are both represented by a letter). The real reason for *dx* is that the integral really represents an **infinite sum**. Have you ever seen that big sigma symbol for a sum? The integral symbol (here *I*) is like this, it likewise says "make an infinite sum of what will follow". But if we take a function and make infinitely many steps and keep summing the values the function gives us, we will just get [infinity](infinity.md) as the sum, so something is missing. In fact we don't want to sum the function values but rather areas of "tiny strips" we are kind of drawing below the function graph -- now a strip is basically a rectangle: area of a rectangle is computed as its height times its width. Height of the rectangle is the function value (here *2 * x - 2*) and width is *dx*, which represents the "infinitely narrow" interval. This is just to give some idea about WHY it looks like this, but it's cool to ignore it for now.
|
**Wait dude WHAT THE FUCK is this dx shit at the end?** This question is expected. Look: it has to do with the theory behind what the integral mathematically means, for starters one can just ignore it and remember that integral starts with *I*, then the integrated function follows, and then there is *dx* at the end. But to give a bit of explanation: firstly notice the *dx* tells us what the integrated variable is -- usually we have a function with single variable *x* and so it's pretty clear, but once we move to more dimensions we'll have more variables and this *dx* tells us what is a variable (i.e. along which axis we are integrating) and what is to be treated as a constant (maybe this doesn't yet make much sense but with integration there is a big difference between a variable and a constant, even if they are both represented by a letter). The real reason for *dx* is that the integral really represents an **infinite sum**. Have you ever seen that big sigma symbol for a sum? The integral symbol (here *I*) is like this, it likewise says "make an infinite sum of what will follow". But if we take a function and make infinitely many steps and keep summing the values the function gives us, we will just get [infinity](infinity.md) as the sum, so something is missing. In fact we don't want to sum the function values but rather areas of "tiny strips" we are kind of drawing below the function graph -- now a strip is basically a rectangle: area of a rectangle is computed as its height times its width. Height of the rectangle is the function value (here *2 * x - 2*) and width is *dx*, which represents the "infinitely narrow" interval. This is just to give some idea about WHY it looks like this, but it's cool to ignore it for now.
|
||||||
|
|
||||||
So now the fuck we can finally move on. Our integral is really easy because it's just a sum of two expressions (and an integral of a sum thankfully equals a sum of integrals) that can be integrated easily. So from the rule *I N * x dx = x^(N + 1) / N* we deduce that integral of *2 * x* is *2 * x^3 / 2 = x^3* and integral of *-2* is *-2 * x*, so we get:
|
Here are some rules for integration:
|
||||||
|
|
||||||
*I 2 * x - 2 dx = x^3 - 2 * x + C*
|
| *f(x)* | *I f(x) dx* | comment |
|
||||||
|
| -------------------- | ----------------------------------------------------- | ---------- |
|
||||||
|
| *a * x^n* | *a * (x^(n+1))/(n+1) + C* | |
|
||||||
|
| *cos(x)* | *sin(x) + C* | |
|
||||||
|
| *sin(x)* | *-cos(x) + C* | |
|
||||||
|
| *e^x* | *e^x + C* | |
|
||||||
|
| *1/x* | *log(x) + C* | |
|
||||||
|
| *a * g(x) + b * h(x)*| *a * (I g(x) dx) + b * (I h(x) dx) + C* | |
|
||||||
|
| *g(x) * h(x)* | *g(x) * (I h(x) dx) - (I g'(x) * (I h(x) dx) dx) + C* | per partes |
|
||||||
|
|
||||||
|
So now the fuck we can finally move on. Our integral is really easy because it's just a sum of two expressions (and an integral of a sum thankfully equals a sum of integrals) that can be integrated easily. So from the rule *I x^N dx = x^(N + 1) / (N + 1)* we deduce that integral of *2 * x* is *2 * x^2 / 2 = x^2* and integral of *-2* is *-2 * x*, so we get:
|
||||||
|
|
||||||
|
*I (2 * x - 2) dx = x^2 - 2 * x + C*
|
||||||
|
|
||||||
A few things to note here now:
|
A few things to note here now:
|
||||||
|
|
||||||
- Notice the additive constant *C* at the end. We always have to include this constant in the result of indefinite integral, like already mentioned. For example imagine if we set *C = 0*, then we'll get a function *x^3 - 2 * x*, and if we differentiate this back, we'll get the function we integrated: *2 * x - 2*. But we will also get the same function no matter what *C* we set because, like explained in the derivative section, additive constants disappear in differentiation. So just never forget this constant. We didn't obtain a single function but an infinite set of functions that differ just by the value of *C* (i.e. their graphs are just vertically shifted).
|
- Notice the additive constant *C* at the end. We always have to include this constant in the result of indefinite integral, like already mentioned. For example imagine if we set *C = 0*, then we'll get a function *x^2 - 2 * x*, and if we differentiate this back, we'll get the function we integrated: *2 * x - 2*. But we will also get the same function no matter what *C* we set because, like explained in the derivative section, additive constants disappear in differentiation. So just never forget this constant. We didn't obtain a single function but an infinite set of functions that differ just by the value of *C* (i.e. their graphs are just vertically shifted).
|
||||||
- We in fact DID receive back the original function from the derivative example, which was *x^3 - 2 * x + 3*, which confirms our result as correct. Or, as per above, we should rather say again that this function is a part of the set of functions we computed, one with *C = 3*.
|
- We in fact DID receive back the original function from the derivative example, which was *x^2 - 2 * x + 3*, which confirms our result as correct. Or, as per above, we should rather say again that this function is a part of the set of functions we computed, one with *C = 3*.
|
||||||
|
|
||||||
Our example integral wasn't that hard, right? Yes, this was extremely easy, but once you start integrating something with composed functions (functions inside other functions) you'll get into all sorts of trouble.
|
Our example integral wasn't that hard, right? Yes, this was extremely easy, but once you start integrating something with composed functions (functions inside other functions) you'll get into all sorts of trouble.
|
||||||
|
|
||||||
Now let's finish with computing a definite integral, OK? Let's say we want to compute the integral over interval 0 to 1, i.e. we'll write:
|
Now let's finish with computing a definite integral, OK? Let's say we want to compute the integral over interval 0 to 1, i.e. we'll write:
|
||||||
|
|
||||||
*I(0,1) 2 * x - 2 dx*
|
*I(0,1) (2 * x - 2) dx*
|
||||||
|
|
||||||
Above we said this is done by computing indefinite integral (already done), then plugging the upper and lower bound and subtracting, so let's do it:
|
Above we said this is done by computing indefinite integral (already done), then plugging the upper and lower bound and subtracting, so let's do it:
|
||||||
|
|
||||||
*I(0,1) 2 * x - 2 dx = (1^3 - 2 * 1 + C) - (0^3 - 2 * 0 + C) = -1*
|
*I(0,1) (2 * x - 2) dx = (1^3 - 2 * 1 + C) - (0^3 - 2 * 0 + C) = -1*
|
||||||
|
|
||||||
Things to notice here:
|
Things to notice here:
|
||||||
|
|
||||||
|
@ -182,6 +224,90 @@ TODO: the rules
|
||||||
|
|
||||||
**Can we do higher order integrals and partial integrals?** Yes, of course, just like with derivatives we can do both of these.
|
**Can we do higher order integrals and partial integrals?** Yes, of course, just like with derivatives we can do both of these.
|
||||||
|
|
||||||
|
## Super Simple Numerical Calculus Example
|
||||||
|
|
||||||
|
Here is a small [C](c.md) code that produces the image at the top showing a graph of a function, its derivative and integral. Please keep in mind this is the most naive example using the simplest algorithm that in practice would be too inaccurate and/or inefficient, but it's good for demonstration. For shorter code we resort to using [floating point](float.md) but of course we can always avoid it with [fixed point](fixed_point.md). You can try to play around with the function and see how its derivative and integral changes. Note that the plotted integral is indeed just one of the infinitely many integrals that would be differently vertically shifted by the constant *C* -- here we just plot the one that at *x = 0* goes through 0.
|
||||||
|
|
||||||
|
```
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
#define GRAPH_RESX 64 // ASCII graph resolution
|
||||||
|
#define GRAPH_RESY 28
|
||||||
|
#define GRAPH_SIZE 2.5 // interval shown in the graph
|
||||||
|
#define DX 0.01 // for numeric methods
|
||||||
|
|
||||||
|
double f(double x) // our function
|
||||||
|
{
|
||||||
|
return 1 + sin(2 * x) + 0.2 * x * x;
|
||||||
|
}
|
||||||
|
|
||||||
|
double derivative(double (*f)(double), double x)
|
||||||
|
{
|
||||||
|
return (f(x + DX) - f(x)) / DX;
|
||||||
|
}
|
||||||
|
|
||||||
|
double integral(double (*f)(double), double x)
|
||||||
|
{
|
||||||
|
int steps = x / DX;
|
||||||
|
double r = 0;
|
||||||
|
int flip = x < 0;
|
||||||
|
|
||||||
|
if (x < 0)
|
||||||
|
steps *= -1;
|
||||||
|
else
|
||||||
|
x = 0;
|
||||||
|
|
||||||
|
while (steps)
|
||||||
|
{
|
||||||
|
r += f(x) * DX;
|
||||||
|
steps--;
|
||||||
|
x += DX;
|
||||||
|
}
|
||||||
|
|
||||||
|
return flip ? -1 * r : r;
|
||||||
|
}
|
||||||
|
|
||||||
|
char graphImage[GRAPH_RESX * GRAPH_RESY];
|
||||||
|
|
||||||
|
void graphDraw(double x, double y, char c)
|
||||||
|
{
|
||||||
|
int drawX = ((x + GRAPH_SIZE) / (2 * GRAPH_SIZE)) * GRAPH_RESX,
|
||||||
|
drawY = GRAPH_RESY - ((y + GRAPH_SIZE) / (2 * GRAPH_SIZE)) * GRAPH_RESY;
|
||||||
|
|
||||||
|
if (drawX >= 0 && drawX < GRAPH_RESX && drawY >= 0 && drawY < GRAPH_RESY)
|
||||||
|
graphImage[drawY * GRAPH_RESX + drawX] = c;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
// clear the graph image:
|
||||||
|
for (int i = 0; i < GRAPH_RESX * GRAPH_RESY; ++i)
|
||||||
|
graphImage[i] = (i % GRAPH_RESX) == GRAPH_RESX / 2 ? ':' :
|
||||||
|
((i / GRAPH_RESX) == GRAPH_RESY / 2 ? '-' : ' ');
|
||||||
|
|
||||||
|
// now plot the function, its derivative and integral
|
||||||
|
for (double x = -1 * GRAPH_SIZE; x < GRAPH_SIZE;
|
||||||
|
x += GRAPH_SIZE / (2 * GRAPH_RESX))
|
||||||
|
{
|
||||||
|
graphDraw(x,integral(f,x),'#');
|
||||||
|
graphDraw(x,derivative(f,x),'*');
|
||||||
|
graphDraw(x,f(x),'x');
|
||||||
|
}
|
||||||
|
|
||||||
|
// draw the graph:
|
||||||
|
for (int i = 0; i < GRAPH_RESX * GRAPH_RESY; ++i)
|
||||||
|
{
|
||||||
|
putchar(graphImage[i]);
|
||||||
|
|
||||||
|
if ((i + 1) % GRAPH_RESX == 0)
|
||||||
|
putchar('\n');
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
## See Also
|
## See Also
|
||||||
|
|
||||||
- [differential equation](differential_equation.md)
|
- [differential equation](differential_equation.md)
|
3629
random_page.md
3629
random_page.md
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
126
wiki_stats.md
126
wiki_stats.md
|
@ -2,10 +2,10 @@
|
||||||
|
|
||||||
This is an autogenerated article holding stats about this wiki.
|
This is an autogenerated article holding stats about this wiki.
|
||||||
|
|
||||||
- number of articles: 612
|
- number of articles: 615
|
||||||
- number of commits: 944
|
- number of commits: 945
|
||||||
- total size of all texts in bytes: 4811795
|
- total size of all texts in bytes: 4839800
|
||||||
- total number of lines of article texts: 35380
|
- total number of lines of article texts: 35587
|
||||||
- number of script lines: 294
|
- number of script lines: 294
|
||||||
- occurrences of the word "person": 9
|
- occurrences of the word "person": 9
|
||||||
- occurrences of the word "nigger": 103
|
- occurrences of the word "nigger": 103
|
||||||
|
@ -35,60 +35,71 @@ longest articles:
|
||||||
|
|
||||||
top 50 5+ letter words:
|
top 50 5+ letter words:
|
||||||
|
|
||||||
- which (2647)
|
- which (2673)
|
||||||
- there (2083)
|
- there (2102)
|
||||||
- people (1976)
|
- people (1976)
|
||||||
- example (1634)
|
- example (1657)
|
||||||
- other (1510)
|
- other (1517)
|
||||||
- about (1325)
|
- about (1330)
|
||||||
- number (1288)
|
- number (1296)
|
||||||
- software (1234)
|
- software (1234)
|
||||||
- because (1051)
|
- because (1064)
|
||||||
- their (1030)
|
- their (1032)
|
||||||
- program (1020)
|
- program (1021)
|
||||||
- would (997)
|
- would (1000)
|
||||||
- something (959)
|
- something (961)
|
||||||
- being (952)
|
- being (953)
|
||||||
- things (920)
|
- things (926)
|
||||||
- language (915)
|
- language (915)
|
||||||
- called (890)
|
- called (893)
|
||||||
- simple (821)
|
- simple (826)
|
||||||
- computer (818)
|
- function (826)
|
||||||
- numbers (813)
|
- computer (821)
|
||||||
- without (807)
|
- numbers (818)
|
||||||
|
- without (808)
|
||||||
|
- different (761)
|
||||||
- however (758)
|
- however (758)
|
||||||
- different (758)
|
|
||||||
- programming (751)
|
- programming (751)
|
||||||
- these (742)
|
- these (747)
|
||||||
- function (741)
|
- world (723)
|
||||||
- world (722)
|
- system (699)
|
||||||
- system (696)
|
- doesn (681)
|
||||||
- doesn (679)
|
- should (678)
|
||||||
- should (675)
|
- still (669)
|
||||||
- still (666)
|
|
||||||
- games (657)
|
- games (657)
|
||||||
- while (649)
|
- while (652)
|
||||||
- drummyfish (633)
|
- point (642)
|
||||||
- point (632)
|
- drummyfish (635)
|
||||||
- society (631)
|
- society (631)
|
||||||
- simply (620)
|
- simply (622)
|
||||||
- possible (608)
|
- possible (610)
|
||||||
- using (600)
|
- using (601)
|
||||||
- probably (586)
|
- probably (588)
|
||||||
- always (574)
|
- always (585)
|
||||||
- course (569)
|
- course (572)
|
||||||
- though (568)
|
- though (570)
|
||||||
- similar (565)
|
- similar (570)
|
||||||
- https (565)
|
- https (565)
|
||||||
- basically (554)
|
- basically (561)
|
||||||
- really (538)
|
- really (542)
|
||||||
|
- actually (542)
|
||||||
- someone (537)
|
- someone (537)
|
||||||
- memory (535)
|
- memory (536)
|
||||||
- actually (535)
|
|
||||||
|
|
||||||
latest changes:
|
latest changes:
|
||||||
|
|
||||||
```
|
```
|
||||||
|
Date: Sun Dec 15 20:50:53 2024 +0100
|
||||||
|
ashley_jones.md
|
||||||
|
binary.md
|
||||||
|
calculus.md
|
||||||
|
derivative.md
|
||||||
|
integral.md
|
||||||
|
often_confused.md
|
||||||
|
random_page.md
|
||||||
|
wiki_pages.md
|
||||||
|
wiki_stats.md
|
||||||
|
work.md
|
||||||
Date: Sat Dec 14 16:25:29 2024 +0100
|
Date: Sat Dec 14 16:25:29 2024 +0100
|
||||||
debugging.md
|
debugging.md
|
||||||
disease.md
|
disease.md
|
||||||
|
@ -111,19 +122,6 @@ Date: Sat Dec 14 16:25:29 2024 +0100
|
||||||
xxiivv.md
|
xxiivv.md
|
||||||
Date: Fri Dec 13 20:40:56 2024 +0100
|
Date: Fri Dec 13 20:40:56 2024 +0100
|
||||||
90s.md
|
90s.md
|
||||||
freedom.md
|
|
||||||
hitler.md
|
|
||||||
internet.md
|
|
||||||
logic_gate.md
|
|
||||||
lrs_dictionary.md
|
|
||||||
progress.md
|
|
||||||
random_page.md
|
|
||||||
shortcut_thinking.md
|
|
||||||
soyence.md
|
|
||||||
technology.md
|
|
||||||
wiki_pages.md
|
|
||||||
wiki_stats.md
|
|
||||||
Date: Thu Dec 12 21:58:18 2024 +0100
|
|
||||||
```
|
```
|
||||||
|
|
||||||
most wanted pages:
|
most wanted pages:
|
||||||
|
@ -163,21 +161,21 @@ most popular and lonely pages:
|
||||||
- [censorship](censorship.md) (112)
|
- [censorship](censorship.md) (112)
|
||||||
- [modern](modern.md) (111)
|
- [modern](modern.md) (111)
|
||||||
- [computer](computer.md) (108)
|
- [computer](computer.md) (108)
|
||||||
- [kiss](kiss.md) (106)
|
- [kiss](kiss.md) (107)
|
||||||
- [fun](fun.md) (104)
|
- [fun](fun.md) (104)
|
||||||
- [programming](programming.md) (101)
|
- [programming](programming.md) (102)
|
||||||
- [math](math.md) (100)
|
- [math](math.md) (101)
|
||||||
- [gnu](gnu.md) (97)
|
- [gnu](gnu.md) (97)
|
||||||
- [shit](shit.md) (95)
|
- [shit](shit.md) (95)
|
||||||
- [linux](linux.md) (95)
|
- [linux](linux.md) (95)
|
||||||
- [fight_culture](fight_culture.md) (94)
|
- [fight_culture](fight_culture.md) (94)
|
||||||
- [bullshit](bullshit.md) (92)
|
- [bullshit](bullshit.md) (93)
|
||||||
- [woman](woman.md) (90)
|
- [woman](woman.md) (91)
|
||||||
- [hacking](hacking.md) (90)
|
- [hacking](hacking.md) (90)
|
||||||
- [corporation](corporation.md) (87)
|
- [corporation](corporation.md) (87)
|
||||||
- [less_retarded_society](less_retarded_society.md) (86)
|
- [less_retarded_society](less_retarded_society.md) (86)
|
||||||
|
- [art](art.md) (86)
|
||||||
- [free_culture](free_culture.md) (85)
|
- [free_culture](free_culture.md) (85)
|
||||||
- [art](art.md) (85)
|
|
||||||
- [public_domain](public_domain.md) (83)
|
- [public_domain](public_domain.md) (83)
|
||||||
- [pseudoleft](pseudoleft.md) (83)
|
- [pseudoleft](pseudoleft.md) (83)
|
||||||
- [chess](chess.md) (83)
|
- [chess](chess.md) (83)
|
||||||
|
|
2
work.md
2
work.md
|
@ -39,7 +39,7 @@ For lawyer cunts: we officially DO NOT ADVISE any illegal methods mentioned here
|
||||||
- **Getting a rich partner?**: someone rich can just take care of you for sex and love, however it may be not worth it as rich people are often capitalists whom it's better to stay away from.
|
- **Getting a rich partner?**: someone rich can just take care of you for sex and love, however it may be not worth it as rich people are often capitalists whom it's better to stay away from.
|
||||||
- **Moving to some nice community that doesn't force work**: the problem is actually finding such community, but maybe some hippie tent villages could be like that -- look up *mutual aid networks*. Multiple people living together can be an advantage, they may pool in money to pay the absolutely necessary bills like property tax -- this will spread the expenses over many people so that every member will have to pay just a very small amount per year. They may then use their land to establish a micro community that works on [communist](communism.md) principles, making their own food etc.
|
- **Moving to some nice community that doesn't force work**: the problem is actually finding such community, but maybe some hippie tent villages could be like that -- look up *mutual aid networks*. Multiple people living together can be an advantage, they may pool in money to pay the absolutely necessary bills like property tax -- this will spread the expenses over many people so that every member will have to pay just a very small amount per year. They may then use their land to establish a micro community that works on [communist](communism.md) principles, making their own food etc.
|
||||||
- **Going to [jail](jail.md)**: in some countries prisons are quite luxurious and once in jail you can just refuse to work as they cannot lock you up more. In jail you have shelter and food, i.e. already more than most people in a capitalist society. However watch out: for some crimes you may just get fined, not actually locked up, so it's good to study the law to know which crimes it's best to commit to safely get one to jail. Your inspiration may be David Hampson who repeatedly gets himself arrested by standing in the middle of the road and then just refuses to talk to anyone.
|
- **Going to [jail](jail.md)**: in some countries prisons are quite luxurious and once in jail you can just refuse to work as they cannot lock you up more. In jail you have shelter and food, i.e. already more than most people in a capitalist society. However watch out: for some crimes you may just get fined, not actually locked up, so it's good to study the law to know which crimes it's best to commit to safely get one to jail. Your inspiration may be David Hampson who repeatedly gets himself arrested by standing in the middle of the road and then just refuses to talk to anyone.
|
||||||
- **Moving to area where disasters happen regularly**, like some highly earthquake rich land, may allow one to just jump charities. It's hard to keep businesses running under a volcano that erupts every other week, so you just run around from charity tent to another one, get food, free healthcare etc. It may also be a nice, adventurous life.
|
- **Moving to area where disasters happen regularly**, like some highly earthquake rich land, may allow one to just jump the humanitarian help. It's hard to keep businesses running under a volcano that erupts every other week, so you just run around from charity tent to another one, get food, free healthcare etc. It may also be a nice, adventurous life.
|
||||||
- **US edition: suing the employer**: If you're a [woman](woman.md), nowadays you can successfully sue anyone for rape, you don't even need evidence, making $1000000 shouldn't be a problem. A non-white can play it on [racism](racism.md), a "disabiled" man can play it on disability etc. However one mustn't hurt a fellow working class poorfag, it must be made so that the comapany or some rich manager pays. IN THEORY it is possible to plot with one's coworkers -- for example the coworkers on same positions talk to each other, reveal their pays to one another, then the one with lowest pay sues for discrimination and they split the profit. Etc.
|
- **US edition: suing the employer**: If you're a [woman](woman.md), nowadays you can successfully sue anyone for rape, you don't even need evidence, making $1000000 shouldn't be a problem. A non-white can play it on [racism](racism.md), a "disabiled" man can play it on disability etc. However one mustn't hurt a fellow working class poorfag, it must be made so that the comapany or some rich manager pays. IN THEORY it is possible to plot with one's coworkers -- for example the coworkers on same positions talk to each other, reveal their pays to one another, then the one with lowest pay sues for discrimination and they split the profit. Etc.
|
||||||
- **Becoming a prostitute (usually for [women](woman.md))**: it's easy money and you literally get paid for having [sex](sex.md). Unless you're real ugly it may be enough to just "work" like this for a few days in a month. With shit like OnlyFans you don't even have to actually have real sex or risk STDs, it's literally like godmode cheat for women.
|
- **Becoming a prostitute (usually for [women](woman.md))**: it's easy money and you literally get paid for having [sex](sex.md). Unless you're real ugly it may be enough to just "work" like this for a few days in a month. With shit like OnlyFans you don't even have to actually have real sex or risk STDs, it's literally like godmode cheat for women.
|
||||||
- **The gypsy way: making tons of children**: gypsies managed to [hack](hacking.md) the system by just making 10, 15 or maybe 20 children -- not only you stay on maternal leave, but you can take financial support for every one of them. The genius of this method is that since CHILDREN ARE MAGICAL, the state HAS TO make sure children are properly cared for AND at the same time it's difficult (e.g. enraging to [feminists](feminism.md) but even just general public) and messy to separate children from their mother, SO as long as a woman is a mother of a non-adult child, she can just 100% refuse to work and the state has no other choice than throw money at her so that the children (and the mother along with them) are fine. So a woman just makes 2 or 3 children, then as they're reaching 18 she makes another and so on until old age. The only danger is in actually getting the children taken away, so a big stress is on NOT taking drugs, NOT drinking, NOT doing idiotic shit like beating the children, NOT whoring for more money and so on.
|
- **The gypsy way: making tons of children**: gypsies managed to [hack](hacking.md) the system by just making 10, 15 or maybe 20 children -- not only you stay on maternal leave, but you can take financial support for every one of them. The genius of this method is that since CHILDREN ARE MAGICAL, the state HAS TO make sure children are properly cared for AND at the same time it's difficult (e.g. enraging to [feminists](feminism.md) but even just general public) and messy to separate children from their mother, SO as long as a woman is a mother of a non-adult child, she can just 100% refuse to work and the state has no other choice than throw money at her so that the children (and the mother along with them) are fine. So a woman just makes 2 or 3 children, then as they're reaching 18 she makes another and so on until old age. The only danger is in actually getting the children taken away, so a big stress is on NOT taking drugs, NOT drinking, NOT doing idiotic shit like beating the children, NOT whoring for more money and so on.
|
||||||
|
|
Loading…
Reference in a new issue