initial
This commit is contained in:
19
Reference/Cosine (Basic Chip)/README.md
Normal file
19
Reference/Cosine (Basic Chip)/README.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# Cosine
|
||||
|
||||
This script calculates the cosine of an angle (in degrees) on an **advanced** level Yolol chip.
|
||||
|
||||
## Inputs
|
||||
|
||||
The input is a single number in the `:i` field.
|
||||
|
||||
- `:i` number (degrees. must be greater than zero)
|
||||
|
||||
## Outputs
|
||||
|
||||
The output is a single number in the `:o` field.
|
||||
|
||||
- `:o` Cosine(:i)
|
||||
|
||||
## Credits
|
||||
|
||||
- Zijkhal#0154
|
||||
7
Reference/Cosine (Basic Chip)/cos.yolol
Normal file
7
Reference/Cosine (Basic Chip)/cos.yolol
Normal file
@@ -0,0 +1,7 @@
|
||||
// This line sets up some constants. It must be run before the next
|
||||
// line. Ensure you are not using the variable names anywhere else
|
||||
// in your program.
|
||||
b=5.234 c=23.775 d=29.59 x=360 k=x*250
|
||||
|
||||
// This line calculates the cosine of :i and puts the result into :o
|
||||
i=abs(:i%x-180)-90 o=b*i+((d*i^5)/k-c*i^3)/k :o=(o+o%0.3)/300
|
||||
Reference in New Issue
Block a user