- complètement remanié les scripts pour le WIFI, mais ce n'est pas encore terminé

This commit is contained in:
Christian Zufferey
2018-08-22 14:57:27 +02:00
parent e43b6f7540
commit 03686ac105
49 changed files with 207 additions and 21 deletions

View File

@@ -1,24 +1,49 @@
-- tests des routines trigonométriques pour NodeMCU
print("\ntest_trigo1.lua zf180820.2209 \n")
print("\ntest_trigo1.lua zf1808201.1758 \n")
-- chargement des routines trigonométriques
dofile("trigo3.lua")
for i = 0, 2*math.pi, 2*math.pi/32 do
for i = 0, 4*math.pi, 4*math.pi/64 do
a=i
-- b=math.tan(a)
-- print("arctangente: "..a..", "..b..", "..math.atan(b)..", "..zatan(b)..", "..math.atan(b)/zatan(b))
b=math.tan(a)
print("arctangente: "..a..", "..b..", "..math.atan(b)..", "..zatan(b)..", "..math.atan(b)/zatan(b))
-- print("sinus: "..a..", "..math.sin(a)..", "..zsin(a)..", "..math.sin(a)/zsin(a))
-- print("cosinus: "..a..", "..math.cos(a)..", "..zcos(a)..", "..math.cos(a)/zcos(a))
-- print("tangente: "..a..", "..math.tan(a)..", "..ztan(a)..", "..math.tan(a)/ztan(a))
-- b=math.sin(a)
b=math.sin(a)
-- print("arcsinus: "..a..", "..b..", "..math.asin(b)..", "..zasin(b)..", "..math.asin(b)/zasin(b))
b=math.cos(a)
print("arccosinus: "..a..", "..b..", "..math.acos(b)..", "..zacos(b)..", "..math.acos(b)/zacos(b))
-- print("arccosinus: "..a..", "..b..", "..math.acos(b)..", "..zacos(b)..", "..math.acos(b)/zacos(b))
end
print("\n")
x=-0.70710678118655
print(math.acos(x))
print(zatan(math.sqrt(1-x*x)/x))
print(math.sqrt(1-x*x)/x)
y=2.5525440310417
print("y: "..y)
x=math.cos(y)
print("x: "..x)
print("math.acos: "..math.acos(x))
z=math.sqrt(1-x*x)/x
print("z: "..z)
print("zatan: "..zatan(z))
--

View File

@@ -5,7 +5,7 @@
print("\ntrigo3.lua zf180820.2205 \n")
Gros problème encore avec les atan négatives et du coup avec les acos, zf180820.2252
-- encore des problèmes, 8% d'erreur, avec les atan vers pi/4, zf180821.1849
function zsin(x)
@@ -33,7 +33,9 @@ function zasin(x)
end
function zacos(x)
return zatan(math.sqrt(1-x*x)/x)
-- return zatan(math.sqrt(1-x*x)/x)
--return math.pi/2-zatan(x/math.sqrt(1-x*x))
return math.pi/2-zasin(x)
end