This commit is contained in:
Miloslav Ciz 2022-05-30 17:53:44 +02:00
parent ccda82a491
commit 24d64c8b79
10 changed files with 133 additions and 6 deletions

2
art.md
View file

@ -1,6 +1,6 @@
# Art # Art
Art is an endeavor that seeks discovery and creation of [beauty](beauty.md) and primarily relies on intuition. While the most immediate examples of art that come to mind are for example [music](music.md) and painting, even the most [scientific](science.md) and rigorous effort like [math](math.md) and [programming](programming.md) become art when pushed to the highest level, to the boundaries of current knowledge where intuition becomes important for further development. Art is an endeavor that seeks discovery and creation of [beauty](beauty.md) and primarily relies on intuition. While the most immediate examples of art that come to mind are for example [music](music.md) and painting, even the most [scientific](science.md) and rigorous effort like [math](math.md) and [programming](programming.md) becomes art when pushed to the highest level, to the boundaries of current knowledge where intuition becomes important for further development.
## See Also ## See Also

18
faq.md
View file

@ -6,6 +6,10 @@
No. No.
### What the fuck?
See [WTF](wtf.md).
### How does LRS differ from [suckless](suckless.md), [KISS](kiss.md) and similar types of software? ### How does LRS differ from [suckless](suckless.md), [KISS](kiss.md) and similar types of software?
These sets largely overlap and LRS is often just a slightly different angle of looking at the same things. I have invented LRS as my own take on suckless software -- as I cannot speak on behalf of the whole suckless community, I have created my own "fork" and simply set my own definitions without worrying about misinterpreting and misquoting someone else. However, LRS does have its specific ideas and areas of focus such as its stress on public domain and legal safety, altruism, anti-capitalism, accepting software such as games, NOT subscribing to the [productivity cult](productivity_cult.md), seeing [privacy](privacy.md) as ultimately undesirable etc. These sets largely overlap and LRS is often just a slightly different angle of looking at the same things. I have invented LRS as my own take on suckless software -- as I cannot speak on behalf of the whole suckless community, I have created my own "fork" and simply set my own definitions without worrying about misinterpreting and misquoting someone else. However, LRS does have its specific ideas and areas of focus such as its stress on public domain and legal safety, altruism, anti-capitalism, accepting software such as games, NOT subscribing to the [productivity cult](productivity_cult.md), seeing [privacy](privacy.md) as ultimately undesirable etc.
@ -26,9 +30,9 @@ Going for the simple technology doesn't necessarily have to mean we have to give
At the moment it's just me, [drummyfish](drummyfish.md). This started as a collaborative wiki name *based wiki* but after some disagreements I forked it (everything was practically written by me at that point) and made it my own wiki where I don't have to make any compromises or respect anyone else's opinions. I'm not opposed to the idea of collaboration but I bet we disagree on something in which case I probably don't want to let you edit this. I also resist allowing contributions because with multiple authors the chance of legal complications grows, even if the work is under a free license or waiver (refer to e.g. the situation where some Linux developers were threatening to withdraw their code contribution license). But you can totally fork this wiki, it's [public domain](cc0.md). At the moment it's just me, [drummyfish](drummyfish.md). This started as a collaborative wiki name *based wiki* but after some disagreements I forked it (everything was practically written by me at that point) and made it my own wiki where I don't have to make any compromises or respect anyone else's opinions. I'm not opposed to the idea of collaboration but I bet we disagree on something in which case I probably don't want to let you edit this. I also resist allowing contributions because with multiple authors the chance of legal complications grows, even if the work is under a free license or waiver (refer to e.g. the situation where some Linux developers were threatening to withdraw their code contribution license). But you can totally fork this wiki, it's [public domain](cc0.md).
### Since it is public domain, can I take this wiki and do anything with it? Even something you don't like? ### Since it is public domain, can I take this wiki and do anything with it? Even something you don't like, like sell it or rewrite it in a different way?
Yes... well, anything that's not otherwise illegal like falsely claiming authorship (copyright) of the original text. This is not because I care about being credited, I don't, but because I care about this wiki not being owned by anyone. You can however claim copyright to anything you add to the wiki if you fork it, as that's your original creation. Yes, you can do anything... well, anything that's not otherwise illegal like falsely claiming authorship (copyright) of the original text. This is not because I care about being credited, I don't (you DON'T have to give me any credit), but because I care about this wiki not being owned by anyone. You can however claim copyright to anything you add to the wiki if you fork it, as that's your original creation.
### Why not keep politics out of this Wiki and make it purely about technology? ### Why not keep politics out of this Wiki and make it purely about technology?
@ -56,6 +60,16 @@ It also has the nice side effect of making this less likely to be used by corpor
The culture of being offended is [bullshit](bullshit.md), it is a [pseudoleftist](pseudoleft.md) (fascist) invention that serves as a weapon to justify censorship, canceling and bullying of people. Since I love all people, I don't support any weapons against anyone (not even against people I dislike or disagree with). People are offended by language because they're taught to be offended by it by the propaganda, I am helping them unlearn it. The culture of being offended is [bullshit](bullshit.md), it is a [pseudoleftist](pseudoleft.md) (fascist) invention that serves as a weapon to justify censorship, canceling and bullying of people. Since I love all people, I don't support any weapons against anyone (not even against people I dislike or disagree with). People are offended by language because they're taught to be offended by it by the propaganda, I am helping them unlearn it.
### But how can you so pretentiously preach "absolute love" and then say you hate capitalists, fascists, bloat etc.?
OK, firstly we do NOT love *everything*, we do NOT advocate against hate itself, only against hate of living beings (note we say we love *everyone*, not *everything*). Hating other things than living beings, such as some bad ideas or malicious objects, is totally acceptable, there's no problem with it. We in fact think hate of some concepts is necessary for finding better ways.
Now when it comes to *"hating"* people, there's an important distinction to be stressed: we never hate a living being as such, we may only hate their properties. So when we say we *hate* someone, it's merely a matter of language convenience -- saying we *hate* someone never means we hate a person as such, but only some thing about that person, for example his opinions, his work, actions, behavior or even appearance. I can hear you ask: what's the difference? The difference is we'll never try to eliminate a living being or cause it suffering because we love it, we may only try to change, in non-violent ways, their attributes we find wrong (which we *hate*): for example we may try to educate the person, point out errors in his arguments, give him advice, and if that doesn't work we may simply choose to avoid his presence. But we will never target hate against him.
### So you really "love" everyone, even dicks like Trump, school shooters, instagram influencers etc.?
Yes, but it may need an elaboration. There are many different kinds of love: love of a sexual partner, love of a parent, love of a pet, love of a hobby, love of nature etc. Obviously we can't love everyone with the same kind of love we have e.g. for our life partner, that's impossible if we've actually never even seen most people who live on this planet. The love we are talking about -- our universal love of everyone -- is an unconditional love of life itself. Being alive is a miracle, it's beautiful, and as living beings we feel a sense of connection with all other living beings in this universe who were for some reason chosen to experience this rare miracle as well -- we know what it feels like to live and we know other living beings experience this special, mysterious privilege too, though for a limited time. This is the most basic kind of love, an empathy, the happiness of seeing someone else live. It is sacred, there's nothing more pure in this universe than feeling this empathy, it works without language, without science, without explanation. While not all living beings are capable of this love (a virus probably won't feel any empathy), we believe all humans have this love in them, even if it's being suppressed by their environment that often forces them compete, hate, even kill. Our goal is to awaken this love in everyone as we believe it's the only way to achieve a truly happy coexistence of us, living beings.
### I dislike this wiki, our teacher taught us that global variables are bad and that OOP is good. ### I dislike this wiki, our teacher taught us that global variables are bad and that OOP is good.
This is not a question you dummy. Have you even read the title of this page? Anyway, your teacher is stupid, he is, very likely unknowingly, just spreading the capitalist propaganda. He probably believes what he's saying but he's wrong. This is not a question you dummy. Have you even read the title of this page? Anyway, your teacher is stupid, he is, very likely unknowingly, just spreading the capitalist propaganda. He probably believes what he's saying but he's wrong.

7
fascism.md Normal file
View file

@ -0,0 +1,7 @@
# Fascism
Fascist group is that which strongly pursues [self interest](self_interest.md). Fascism is a [rightist](left_right.md), [competitive](competition.md) tendency; fascists aim to make themselves as strong, as powerful and as rich as possible, i.e. to weaken and possibly eliminate competing groups, to have power over them, enslave them and to seize their resources. The means of their operation are almost exclusively [evil](evil.md), including [violence](violence.md), [bullying](bully.md), [wars](war.md), [propaganda](propaganda.md), [eye for an eye](revenge.md), [slavery](slavery.md) etc.
A few examples of fascist groups are [corporations](corporation.md), [nations](nationalism.md), NSDAP ([Nazis](nazi.md)), [LGBT](lgbt.md), [feminists](feminism.md), [Antifa](antifa.md), [KKK](kkk.md), [Marxists](marxism.md) and, of course, the infamous Italian fascist party of Benito Mussolini.
Fascism is always bad and we have to aim towards eliminating it. However here comes a great warning: **in eliminating fascism be extremely careful to not become a fascist yourself**. We purposefully do NOT advice to *[fight](fight_culture.md)* fascism as fight implies violence, the tool of fascism. **Elimination of fascism has to be done in a [non-violent](nonviolence.md) way**. Sadly, generation after generation keeps repeating the same mistake over and over: they keep opposing fascism by fascist means, eventually taking the oppressors place and becoming the new oppressor, only to again be dethroned by the new generation. This has happened e.g. with [feminism](feminism.md) and other [pseudoleftist](pseudoleft.md) movements. This is an endless cycle of stupidity but, more importantly, endless suffering of people. This cycle needs to be ended. We must choose not the easy way of violence, but the difficult way of non-violent rejection which includes loving the enemy as we [love](love.md) ourselves. Fascism is all about loving one's own group while hating the enemy groups -- if we can achieve loving all groups of people, even fascists themselves, fascism will have been by definition eliminated.

3
fascist.md Normal file
View file

@ -0,0 +1,3 @@
# Fascist
See [fascism](fascism.md).

2
gay.md
View file

@ -6,4 +6,6 @@ Even though homosexuality is largely genetically determined, it is also to a gre
There is a terrorist fascist organization called [LGBT](lgbt.md) aiming to make gays superior to other people. There is a terrorist fascist organization called [LGBT](lgbt.md) aiming to make gays superior to other people.
Gays behave pretty weirdly, male gays are very feminine and talk in high pitched voice, lesbians are masculine, have short pink hair. You can usually tell when someone's gay.
Of course, [we](lrs.md) have nothing against gay people as we don't have anything against people with any other disorder -- we love all people. But we do have an issue with any kind of terrorist organization, so while we are okay with gays, we are not okay with LGBT. Of course, [we](lrs.md) have nothing against gay people as we don't have anything against people with any other disorder -- we love all people. But we do have an issue with any kind of terrorist organization, so while we are okay with gays, we are not okay with LGBT.

7
interesting.md Normal file
View file

@ -0,0 +1,7 @@
# Interesting
This is a great answer to anything, if someone tells you something you don't understand or something you think is [shit](shit.md) and you don't know what to say, you just say "interesting".
**All numbers are interesting**: there is a [fun](fun.md) [proof](proof.md) by contradiction of this. Suppose there exists a set of uninteresting numbers; then the greatest of these numbers is interesting by being the greatest uninteresting number -- we've arrived at contradiction, therefore a set of uninteresting numbers cannot exist.
TODO: just list some interesting shit here

13
lgbt.md Normal file
View file

@ -0,0 +1,13 @@
# LGBT
*LGBT ruined the rainbow for me.*
LGBT, LGBTQ+, LGBTQIKKAWTFJJJKKSSMMMAAK (lesbian [gay](gay.md), [bisexual](bisexual.md), [transsexual](tranny.md), [queer](queer.md) and whatever else they're gonna invent) is a [fascist](fascist.md) political group of terrorists whose gospel preaches superiority of certain selected minority sexual orientations. They are a highly [violent](violence.md), [bullying](bully.md) movement (not surprisingly centered in the [US](us.md)) practicing [censorship](censorship.md), Internet lynching ([cancel culture](cancel_culture.md)), discrimination, spread of extreme [propaganda](propaganda.md), [political correctness](political_correctness.md) and other [evil](evil.md).
Note that **not all gay people support LGBT**, even though LGBT wants you to think so. LGBT isn't just about being gay but about approving of a very specific ideology that doesn't automatically come with being gay.
LGBT works towards establishing [newspeak](newspeak.md) and [though crime](though_crime.md), they "pride" parades are not unlike military parades, they're mean to establish fear of their numbers. LGBT targets children and young whom their propaganda floods every day with messages like *"being gay makes you cool and more interesting"* so that they have a higher probability of developing homosexuality to further increase their ranks in the future. They also push the idea of children having same sex parents for the same reason.
They oppose [straight](straight.md) people as they solely focus on gaining more and more rights and power only for their approved orientations. They also highly bully other, unpopular sexual orientations such as [pedophiles](pedophilia.md) (not necessarily child rapists), [necrophiles](necro.md) and [zoophiles](zoophilia.md), simply because supporting these would hurt their popularity and political power. They label the non-approved orientations a "disorder", they push people of such orientations to [suicide](suicide.md) and generally just do all the bad things that society used to do to gay people in the past -- the fact that these people are often gay people who know what it's like to be bullied like that makes it this even much more sad and disgusting. To them it doesn't matter you never hurt anyone, if they find some [loli](loli.md) images on your computer, you're gonna get lynched mercilessly.
In the world of technology they are known for supporting [toxic](toxic.md) [codes of conduct](coc.md) in [FOSS](foss.md) projects (so called [tranny software](tranny_sw.md)), they managed to push them into most mainstream projects, even [Linux](linux.md) etc. Generally they just killed [free speech](free_speech.md) online, every platform now has some kind of surveillance and censorship justified by "offensive speech". They canceled [Richard Stallman](rms.md) for merely questioning a part of their gospel. They also managed to establish things like "diversity" quotas in Hollywood that only allow Oscars to be given to movies made by specific number of gays, lesbians etc. xD Apparently in the software development industry it is now standard to pretend to be a tranny on one's resume so as to greatly increase the chance of being hired xD WTF if I didn't live in this shitty world I wouldn't believe that's even possible, in a dystopian horror movie this would feel like crossing the line of believability too far [lmao](lmao.md).

View file

@ -10,11 +10,13 @@ Every natural number greater than 1 has a unique **prime factorization**, i.e. a
The unique factorization can also nicely be used to encode [multisets](multiset.md) as numbers. We can assign each prime number its sequential number (2 is 0, 3 is 1, 5 is 2, 7 is 3 etc.), then any number encodes a set of numbers (i.e. just their presence, without specifying their order) in its factorization. E.g. 75 = 3 * 5 * 5 encodes a multiset {1, 2, 2}. This can be exploited in cool ways in some [cyphers](cypher.md) etc. The unique factorization can also nicely be used to encode [multisets](multiset.md) as numbers. We can assign each prime number its sequential number (2 is 0, 3 is 1, 5 is 2, 7 is 3 etc.), then any number encodes a set of numbers (i.e. just their presence, without specifying their order) in its factorization. E.g. 75 = 3 * 5 * 5 encodes a multiset {1, 2, 2}. This can be exploited in cool ways in some [cyphers](cypher.md) etc.
When in 1974 the Arecibo radio message was sent to space to carry a message for [aliens](alien.md), the resolution of the bitmap image it carried was chosen to be 73 x 23 pixels -- two primes. This was cleverly done so that when aliens receive the 1679 sequential values, there are only two possible ways to interpret them as a 2D bitmap image: 23 x 73 (incorrect) and 73 x 23 (correct). This increased the probability of correct interpretation against the case of sending an arbitrary resolution image.
**There are infinitely many prime numbers**. The proof is pretty simple (shown below), however it's pretty interesting that it has still not been proven whether there are infinitely many [twin primes](twin_prime.md) (primes that differ by 2), that seems to be an extremely difficult question. **There are infinitely many prime numbers**. The proof is pretty simple (shown below), however it's pretty interesting that it has still not been proven whether there are infinitely many [twin primes](twin_prime.md) (primes that differ by 2), that seems to be an extremely difficult question.
Euklid's [proof](proof.md) shows there are infinitely many primes, it is done by contradiction and goes as follows: suppose there are finitely many primes *p1*, *p2*, ... *pn*. Now let's consider a number *s* = *p1* * *p2* * ... * *pn* + 1. This means *s* - 1 is divisible by each prime *p1*, *p2*, ... *pn*, but *s* itself is not divisible by any of them (as it is just 1 greater than *s* and multiples of some number *q* greater than 1 have to be spaced by *q*, i.e. more than 1). If *s* isn't divisible by any of the considered primes, it itself has to be a prime. However that is in contradiction with the original assumption that *p1*, *p2*, ... *pn* are all existing primes. Therefore a finite list of primes cannot exist, there have to be infinitely many of them. Euklid's [proof](proof.md) shows there are infinitely many primes, it is done by contradiction and goes as follows: suppose there are finitely many primes *p1*, *p2*, ... *pn*. Now let's consider a number *s* = *p1* * *p2* * ... * *pn* + 1. This means *s* - 1 is divisible by each prime *p1*, *p2*, ... *pn*, but *s* itself is not divisible by any of them (as it is just 1 greater than *s* and multiples of some number *q* greater than 1 have to be spaced by *q*, i.e. more than 1). If *s* isn't divisible by any of the considered primes, it itself has to be a prime. However that is in contradiction with the original assumption that *p1*, *p2*, ... *pn* are all existing primes. Therefore a finite list of primes cannot exist, there have to be infinitely many of them.
**Distribution and occurrence of primes**: the occurrence of primes seems kind of """[random](random.md)""" (kind of like digits of [decimal](decimal.md) representation of [pi](pi.md)), without a simple pattern, however hints of patterns appear such as the [Ulam spiral](ulam_spiral.d) -- if we plot natural numbers in a square spiral and mark the primes, we can visually distinguish dimly appearing 45 degree diagonals as well as horizontal and vertical lines. Furthermore the **density of primes decreases** the further away we go from 0. The *prime number theorem* states that a number randomly chosen between 0 and *N* (for large *N*) has approximately 1/log(N) probability of being a prime. **Prime counting function** is a function for *N* tells the number of primes smaller or equal to *N*. While there are 25 primes under 100 (25%), there are 9592 under 100000 (~9.5%) and only 50847534 under 1000000000 (~5%). **Distribution and occurrence of primes**: the occurrence of primes seems kind of """[random](random.md)""" (kind of like digits of [decimal](decimal.md) representation of [pi](pi.md)), without a simple pattern, however hints of patterns appear such as the [Ulam spiral](ulam_spiral.d) -- if we plot natural numbers in a square spiral and mark the primes, we can visually distinguish dimly appearing 45 degree diagonals as well as horizontal and vertical lines. Furthermore the **density of primes decreases** the further away we go from 0. The *prime number theorem* states that a number randomly chosen between 0 and *N* (for large *N*) has approximately 1/log(N) probability of being a prime. **Prime counting function** is a function which for *N* tells the number of primes smaller or equal to *N*. While there are 25 primes under 100 (25%), there are 9592 under 100000 (~9.5%) and only 50847534 under 1000000000 (~5%).
``` ```
, , , ', ' ,' , , ' , , , ', ' ,' , , '
@ -93,7 +95,7 @@ int isPrime(int n)
[Sieve of Eratosthenes](sieve_of_eratosthenes.md) is a simple algorithm to find prime numbers up to a certain bound *N*. The idea of it is following: create a list of numbers up to *N* and then iteratively mark multiples of whole numbers as non-primes. At the end all remaining (non-marked) numbers are primes. If we need to find all primes under *N*, this algorithm is more efficient than testing each number under *N* for primality separately (we're making use of a kind of [dynamic programming](dynamic_programming.md) approach). [Sieve of Eratosthenes](sieve_of_eratosthenes.md) is a simple algorithm to find prime numbers up to a certain bound *N*. The idea of it is following: create a list of numbers up to *N* and then iteratively mark multiples of whole numbers as non-primes. At the end all remaining (non-marked) numbers are primes. If we need to find all primes under *N*, this algorithm is more efficient than testing each number under *N* for primality separately (we're making use of a kind of [dynamic programming](dynamic_programming.md) approach).
Prime factorization: TODO **[Prime factorization](factorization.md)**: We can factor a number by repeatedly [brute force](brute_force.md) checking its divisibility by individual primes and there exist many algorithms applying various optimizations (wheel factorization, Dixon's factorization, ...), however for factoring large (hundreds of bits) primes there exists no known efficient algorithm, i.e. one that would run in [polynomial time](polynomial_time.md), and it is believed no such algorithm exists (see [P vs NP](p_vs_np.md)). Many cryptographic algorithms, e.g. [RSA](rsa.md), rely on factorization being inefficient. For [quantum](quantum.md) computers a polynomial ("fast") algorithm exists, it's called [Shor's algorithm](shors_algorithm.md).
Prime generation: TODO Prime generation: TODO

View file

@ -2,7 +2,7 @@
Productivity cult is one of [modern](modern.md) [capitalist](capitalism.md) religions which praises human productivity above everything, even happiness, well being, sanity etc. Kids nowadays are all about "how to be more productive", they make daily checklists, analyze tables of their weekly performance, give up sleep to study some useless shit required by the current market fluctuation. Productivity cult is all about voluntarily making oneself a robot, a slave to the system. Productivity cult is one of [modern](modern.md) [capitalist](capitalism.md) religions which praises human productivity above everything, even happiness, well being, sanity etc. Kids nowadays are all about "how to be more productive", they make daily checklists, analyze tables of their weekly performance, give up sleep to study some useless shit required by the current market fluctuation. Productivity cult is all about voluntarily making oneself a robot, a slave to the system.
The name of the cult itself [says a lot about it](name_is_important.md). While a name such as *efficiency* would probably be better, as efficiency means doing less work with the same result and therefore being happier, it is not a surprise that capitalism has chosen the word *productivity*, i.e. producing more which means working more, e.g. for the prize of free time and mental health. The name of the cult itself [says a lot about it](name_is_important.md). While a name such as *efficiency* would probably be better, as efficiency means doing less work with the same result and therefore being happier, it is not a surprise that capitalism has chosen the word *productivity*, i.e. producing more which means working more, e.g. for the price of free time and mental health.
Productivity is such a big deal because **programmers are in fact actually getting exponentially less productive** due to overcomplicated buggy [bloat](bloat.md) and billions of frameworks needed to get basic thing done nowadays -- this has been pointed out by [Jonathan Blow](jonathan_blow.md) in his talk *Preventing the Collapse of Civilization* in which he refers to the video of [Ken Thompson](ken_thompson.md) talking about how he developed the [Unix](unix.md) operating system in **three weeks**. Productivity is such a big deal because **programmers are in fact actually getting exponentially less productive** due to overcomplicated buggy [bloat](bloat.md) and billions of frameworks needed to get basic thing done nowadays -- this has been pointed out by [Jonathan Blow](jonathan_blow.md) in his talk *Preventing the Collapse of Civilization* in which he refers to the video of [Ken Thompson](ken_thompson.md) talking about how he developed the [Unix](unix.md) operating system in **three weeks**.

79
sin.md Normal file
View file

@ -0,0 +1,79 @@
# Sine
Sine, abbreviated *sin*, is a [trigonometric](trigonometry.md) [function](function.md) that simply said models a smooth oscillation, it is one of the most important and basic functions in geometry, [mathematics](math.md) and [physics](physics.md), and of course in [programming](programming.md). Along with [cosine](cos.md), [tangent](tan.md) and [cotangent](cot.md) it belongs to a group of functions that can be defined by ratios of sides of a right triangle depending on one of the angles in it (hence *trigonometric* -- "triangle measuring"). If some measurement looks like sine function, we say it is *harmonic*. This is very common in nature and technology, e.g. a weight on a spring goes up and down by this function, [alternating current](ac.md) voltage has the sine shape (because it is generated by a circular motion) etc.
The function is most commonly defined using a right triangle as follows. Consider the following triangle:
```
/|
/ |
/ |
c/ |
/ |a
/ |
/ _|
/A____|_|
b
```
*Sin(A)*, where *A* is the angle between side *b* and *c*, is the ratio *a* / *c*. The function can be defined in many other ways, for example it is the curve we get when tracking only one direction (e.g. horizontal) of a point moving alongside circle. It can also be defined as a solution to some [differential equations](differential_equation.md) etc.
The graph of the sine function is following:
```
^ sin(x)
|
1_|_
| .--'''--.
-1/2 pi | _.'' ''._ 3/2 pi
.________|________.'________|________'|________|________.' --> x
'._ | _.'|0 | |'._ | _.'|
''--___--'' _|_ 1/2 pi pi ''--___--'' 2 pi
-1 |
```
**Why the fuck are there these [pi](pi.md) values on the x line???** Nubs often can't comprehend this. These pi values are values in **[radians](radian.md)**, units of measuring angles where *2 pi* is the full angle (360 degrees). In fact sine is sometimes shown with [degrees](degree.md) instead of radians (so imagine 90 degrees on the line where there is 1/2 pi etc.), but mathematicians prefer radians. **But why are there angles in the first place???** Why doesn't it go e.g. from 0 to 1 like all other nice functions? Well, it's because of the relation to geometry, remember the fucking triangle above... also if you define sine with a circle it all repeats after *2 pi*. Just draw some picture if you don't get it.
Some additional facts and properties regarding the sine functions are:
- The domain are all [real numbers](real_number.md), the [codomain](codomain.md) are real numbers in interval <-1,1> (including both bounds).
- It is an [odd function](odd_function.md) (-sin(x) = sin(-x)).
- It is periodic, with a period of 2 [pi](pi.md).
- Sine is just shifted [cosine](cos.md), i.e. *sin(x) = cos(x - 1/2 pi)*
- Its inverse function is [arcus sine](asin.md), abbreviated *asin*, also written as *sin^-1* -- this function tells you what argument you need to give to sin to get a specific result number. It's actually an inverse of only part of the sine function because the whole sine function can't be inverted, it isn't [bijective](bijection.md).
- [Derivative](derivative.md) of *sin(x)* is *cos(x)*, the [integral](integral.md) of *sin(x) dx* is *-cos(x)*.
- By adding many differently shifted and scaled sine functions we can create basically any other function, see e.g. [cosine transform](cosine_transform.md).
- *sin(x)^2 + cos(x)^2 = 1*
Some values of the sine function are:
| x (rad) | x (deg) | sin(x) |
|----------|----------|--------------------|
| 0 | 0 | 0 |
| pi / 12 | 15 | ~0.259 |
| pi / 6 | 30 | 0.5 |
| pi / 4 | 45 | sqrt(2)/2 ~= 0.707 |
| pi / 3 | 60 | sqrt(3)/2 ~= 0.866 |
| pi / 2 | 90 | 1 |
| 2 pi | 360 | 0 |
## Programming
In programming languages sine is generally available in some math library, for example in [C](c.md) the function `sin` is in `math.h`. Spare yourself bugs, **always check if your sin function expects [radians](radian.md) or degrees!**
There exists an **ugly engineering [approximation](approximation.md)** of sine that can be useful sometimes, it says that
*sin(x) = x, for small x*
Indeed, sine looks similar to a mere line near 0, but you can see it quickly diverges.
When implementing your own `sin` function, consider what you expect from it.
If you want a small, fast and perhaps integer only `sin` function (the one we'd prefer in [LRS](lrs.md)) that doesn't need extreme accuracy, consider using a **[look up table](lut.md)**. You simply precompute the values of the sine function into a static table in memory and the function just retrieves them when called -- this is super fast. Note that you can save a lot of space by **only storing sine values between 0 and 1/2 pi**, the remaining parts of the function are just different transformation of this part. You can further save space and/or make the function work with [floats](float.md) by further [interpolating](interpolation.md) (e.g. just linearly) between the stored values, for example if `sin(3.45)` is called and you only have values stored for `sin(3.4)` and `sin(3.5)`, you simply average them.
Another approach is to use [Taylor series](taylor_series.md) to approximate sine with a [polynomial](polynomial.md) to whatever precision we need (this is used in calculators etc.).