Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,35 +0,0 @@
|
|||
with Ada.Numerics.Elementary_Functions;
|
||||
use Ada.Numerics.Elementary_Functions;
|
||||
with Ada.Float_Text_Io; use Ada.Float_Text_Io;
|
||||
with Ada.Text_IO; use Ada.Text_IO;
|
||||
|
||||
procedure Trig is
|
||||
Degrees_Cycle : constant Float := 360.0;
|
||||
Radians_Cycle : constant Float := 2.0 * Ada.Numerics.Pi;
|
||||
Angle_Degrees : constant Float := 45.0;
|
||||
Angle_Radians : constant Float := Ada.Numerics.Pi / 4.0;
|
||||
procedure Put (V1, V2 : Float) is
|
||||
begin
|
||||
Put (V1, Aft => 5, Exp => 0);
|
||||
Put (" ");
|
||||
Put (V2, Aft => 5, Exp => 0);
|
||||
New_Line;
|
||||
end Put;
|
||||
begin
|
||||
Put (Sin (Angle_Degrees, Degrees_Cycle),
|
||||
Sin (Angle_Radians, Radians_Cycle));
|
||||
Put (Cos (Angle_Degrees, Degrees_Cycle),
|
||||
Cos (Angle_Radians, Radians_Cycle));
|
||||
Put (Tan (Angle_Degrees, Degrees_Cycle),
|
||||
Tan (Angle_Radians, Radians_Cycle));
|
||||
Put (Cot (Angle_Degrees, Degrees_Cycle),
|
||||
Cot (Angle_Radians, Radians_Cycle));
|
||||
Put (ArcSin (Sin (Angle_Degrees, Degrees_Cycle), Degrees_Cycle),
|
||||
ArcSin (Sin (Angle_Radians, Radians_Cycle), Radians_Cycle));
|
||||
Put (Arccos (Cos (Angle_Degrees, Degrees_Cycle), Degrees_Cycle),
|
||||
Arccos (Cos (Angle_Radians, Radians_Cycle), Radians_Cycle));
|
||||
Put (Arctan (Y => Tan (Angle_Degrees, Degrees_Cycle)),
|
||||
Arctan (Y => Tan (Angle_Radians, Radians_Cycle)));
|
||||
Put (Arccot (X => Cot (Angle_Degrees, Degrees_Cycle)),
|
||||
Arccot (X => Cot (Angle_Degrees, Degrees_Cycle)));
|
||||
end Trig;
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
(defun rad_to_deg (rad)(* 180.0 (/ rad PI)))
|
||||
(defun deg_to_rad (deg)(* PI (/ deg 180.0)))
|
||||
|
||||
(defun asin (x)
|
||||
(cond
|
||||
((and(> x -1.0)(< x 1.0)) (atan (/ x (sqrt (- 1.0 (* x x))))))
|
||||
((= x -1.0) (* -1.0 (/ pi 2)))
|
||||
((= x 1) (/ pi 2))
|
||||
)
|
||||
)
|
||||
|
||||
(defun acos (x)
|
||||
(cond
|
||||
((and(>= x -1.0)(<= x 1.0)) (-(* pi 0.5) (asin x)))
|
||||
)
|
||||
)
|
||||
|
||||
(list
|
||||
(list "cos PI/6" (cos (/ pi 6)) "cos 30 deg" (cos (deg_to_rad 30)))
|
||||
(list "sin PI/4" (sin (/ pi 4)) "sin 45 deg" (sin (deg_to_rad 45)))
|
||||
(list "tan PI/3" (tan (/ pi 3))"tan 60 deg" (tan (deg_to_rad 60)))
|
||||
(list "asin 1 rad" (asin 1.0) "asin 1 rad (deg)" (rad_to_deg (asin 1.0)))
|
||||
(list "acos 1/2 rad" (acos (/ 1 2.0)) "acos 1/2 rad (deg)" (rad_to_deg (acos (/ 1 2.0))))
|
||||
(list "atan pi/12" (atan (/ pi 12)) "atan 15 deg" (rad_to_deg(atan(deg_to_rad 15))))
|
||||
)
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
IDENTIFICATION DIVISION.
|
||||
PROGRAM-ID. Trig.
|
||||
|
||||
DATA DIVISION.
|
||||
WORKING-STORAGE SECTION.
|
||||
01 Pi-Third USAGE COMP-2.
|
||||
01 Degree USAGE COMP-2.
|
||||
|
||||
01 60-Degrees USAGE COMP-2.
|
||||
|
||||
01 Result USAGE COMP-2.
|
||||
|
||||
PROCEDURE DIVISION.
|
||||
COMPUTE Pi-Third = FUNCTION PI / 3
|
||||
|
||||
DISPLAY "Radians:"
|
||||
DISPLAY " Sin(π / 3) = " FUNCTION SIN(Pi-Third)
|
||||
DISPLAY " Cos(π / 3) = " FUNCTION COS(Pi-Third)
|
||||
DISPLAY " Tan(π / 3) = " FUNCTION TAN(Pi-Third)
|
||||
DISPLAY " Asin(0.5) = " FUNCTION ASIN(0.5)
|
||||
DISPLAY " Acos(0.5) = " FUNCTION ACOS(0.5)
|
||||
DISPLAY " Atan(0.5) = " FUNCTION ATAN(0.5)
|
||||
|
||||
COMPUTE Degree = FUNCTION PI / 180
|
||||
COMPUTE 60-Degrees = Degree * 60
|
||||
|
||||
DISPLAY "Degrees:"
|
||||
DISPLAY " Sin(60°) = " FUNCTION SIN(60-Degrees)
|
||||
DISPLAY " Cos(60°) = " FUNCTION COS(60-Degrees)
|
||||
DISPLAY " Tan(60°) = " FUNCTION TAN(60-Degrees)
|
||||
COMPUTE Result = FUNCTION ASIN(0.5) / 60
|
||||
DISPLAY " Asin(0.5) = " Result
|
||||
COMPUTE Result = FUNCTION ACOS(0.5) / 60
|
||||
DISPLAY " Acos(0.5) = " Result
|
||||
COMPUTE Result = FUNCTION ATAN(0.5) / 60
|
||||
DISPLAY " Atan(0.5) = " Result
|
||||
|
||||
GOBACK
|
||||
.
|
||||
|
|
@ -1,24 +1,24 @@
|
|||
import system'math;
|
||||
import extensions;
|
||||
|
||||
public program()
|
||||
public Program()
|
||||
{
|
||||
console.printLine("Radians:");
|
||||
console.printLine("sin(π/3) = ",(Pi_value/3).sin());
|
||||
console.printLine("cos(π/3) = ",(Pi_value/3).cos());
|
||||
console.printLine("tan(π/3) = ",(Pi_value/3).tan());
|
||||
console.printLine("arcsin(1/2) = ",0.5r.arcsin());
|
||||
console.printLine("arccos(1/2) = ",0.5r.arccos());
|
||||
console.printLine("arctan(1/2) = ",0.5r.arctan());
|
||||
console.printLine();
|
||||
Console.printLine("Radians:");
|
||||
Console.printLine("sin(π/3) = ",(Pi_value/3).sin());
|
||||
Console.printLine("cos(π/3) = ",(Pi_value/3).cos());
|
||||
Console.printLine("tan(π/3) = ",(Pi_value/3).tan());
|
||||
Console.printLine("arcsin(1/2) = ",0.5r.arcsin());
|
||||
Console.printLine("arccos(1/2) = ",0.5r.arccos());
|
||||
Console.printLine("arctan(1/2) = ",0.5r.arctan());
|
||||
Console.printLine();
|
||||
|
||||
console.printLine("Degrees:");
|
||||
console.printLine("sin(60º) = ",60.0r.Radian.sin());
|
||||
console.printLine("cos(60º) = ",60.0r.Radian.cos());
|
||||
console.printLine("tan(60º) = ",60.0r.Radian.tan());
|
||||
console.printLine("arcsin(1/2) = ",0.5r.arcsin().Degree,"º");
|
||||
console.printLine("arccos(1/2) = ",0.5r.arccos().Degree,"º");
|
||||
console.printLine("arctan(1/2) = ",0.5r.arctan().Degree,"º");
|
||||
Console.printLine("Degrees:");
|
||||
Console.printLine("sin(60º) = ",60.0r.Radian.sin());
|
||||
Console.printLine("cos(60º) = ",60.0r.Radian.cos());
|
||||
Console.printLine("tan(60º) = ",60.0r.Radian.tan());
|
||||
Console.printLine("arcsin(1/2) = ",0.5r.arcsin().Degree,"º");
|
||||
Console.printLine("arccos(1/2) = ",0.5r.arccos().Degree,"º");
|
||||
Console.printLine("arctan(1/2) = ",0.5r.arctan().Degree,"º");
|
||||
|
||||
console.readChar()
|
||||
Console.readChar()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +0,0 @@
|
|||
$rad = [Math]::PI / 4
|
||||
$deg = 45
|
||||
'{0,10} {1,10}' -f 'Radians','Degrees'
|
||||
'{0,10:N6} {1,10:N6}' -f [Math]::Sin($rad), [Math]::Sin($deg * [Math]::PI / 180)
|
||||
'{0,10:N6} {1,10:N6}' -f [Math]::Cos($rad), [Math]::Cos($deg * [Math]::PI / 180)
|
||||
'{0,10:N6} {1,10:N6}' -f [Math]::Tan($rad), [Math]::Tan($deg * [Math]::PI / 180)
|
||||
$temp = [Math]::Asin([Math]::Sin($rad))
|
||||
'{0,10:N6} {1,10:N6}' -f $temp, ($temp * 180 / [Math]::PI)
|
||||
$temp = [Math]::Acos([Math]::Cos($rad))
|
||||
'{0,10:N6} {1,10:N6}' -f $temp, ($temp * 180 / [Math]::PI)
|
||||
$temp = [Math]::Atan([Math]::Tan($rad))
|
||||
'{0,10:N6} {1,10:N6}' -f $temp, ($temp * 180 / [Math]::PI)
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
$radians = [Math]::PI / 4
|
||||
$degrees = 45
|
||||
|
||||
[PSCustomObject]@{Radians=[Math]::Sin($radians); Degrees=[Math]::Sin($degrees * [Math]::PI / 180)}
|
||||
[PSCustomObject]@{Radians=[Math]::Cos($radians); Degrees=[Math]::Cos($degrees * [Math]::PI / 180)}
|
||||
[PSCustomObject]@{Radians=[Math]::Tan($radians); Degrees=[Math]::Tan($degrees * [Math]::PI / 180)}
|
||||
|
||||
[double]$tempVar = [Math]::Asin([Math]::Sin($radians))
|
||||
[PSCustomObject]@{Radians=$tempVar; Degrees=$tempVar * 180 / [Math]::PI}
|
||||
|
||||
[double]$tempVar = [Math]::Acos([Math]::Cos($radians))
|
||||
[PSCustomObject]@{Radians=$tempVar; Degrees=$tempVar * 180 / [Math]::PI}
|
||||
|
||||
[double]$tempVar = [Math]::Atan([Math]::Tan($radians))
|
||||
[PSCustomObject]@{Radians=$tempVar; Degrees=$tempVar * 180 / [Math]::PI}
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
REBOL [
|
||||
Title: "Trigonometric Functions"
|
||||
URL: http://rosettacode.org/wiki/Trigonometric_Functions
|
||||
]
|
||||
|
||||
radians: pi / 4 degrees: 45.0
|
||||
|
||||
; Unlike most languages, REBOL's trig functions work in degrees unless
|
||||
; you specify differently.
|
||||
|
||||
print [sine/radians radians sine degrees]
|
||||
print [cosine/radians radians cosine degrees]
|
||||
print [tangent/radians radians tangent degrees]
|
||||
|
||||
d2r: func [
|
||||
"Convert degrees to radians."
|
||||
d [number!] "Degrees"
|
||||
][d * pi / 180]
|
||||
|
||||
arcsin: arcsine sine degrees
|
||||
print [d2r arcsin arcsin]
|
||||
|
||||
arccos: arccosine cosine degrees
|
||||
print [d2r arccos arccos]
|
||||
|
||||
arctan: arctangent tangent degrees
|
||||
print [d2r arctan arctan]
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
-- 28 Jul 2025
|
||||
include Settings
|
||||
-- 24 Aug 2025
|
||||
include Setting
|
||||
|
||||
say 'TRIGONOMETRIC FUNCTIONS'
|
||||
say version
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue