From c903afa09d3406d398a2a33c855a117cfad01e74 Mon Sep 17 00:00:00 2001 From: Oleg Kalachev Date: Wed, 12 Sep 2018 23:36:35 +0300 Subject: [PATCH] docs: small fix in snippets --- docs/snippets.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/snippets.md b/docs/snippets.md index bfeb8e2f..34c248ec 100644 --- a/docs/snippets.md +++ b/docs/snippets.md @@ -76,10 +76,10 @@ while True: Определение, перевернут ли коптер: ```python -pi_2 = math.pi / 2 +PI_2 = math.pi / 2 telem = get_telemetry() -flipped = not -pi_2 <= telem.pitch <= pi_2 or not -pi_2 <= telem.roll <= pi_2 +flipped = not -PI_2 <= telem.pitch <= PI_2 or not -PI_2 <= telem.roll <= PI_2 ``` --- @@ -87,10 +87,10 @@ flipped = not -pi_2 <= telem.pitch <= pi_2 or not -pi_2 <= telem.roll <= pi_2 Рассчет общего угла коптера к горизонту: ```python -pi_2 = math.pi / 2 +PI_2 = math.pi / 2 telem = get_telemetry() -flipped = not -pi_2 <= telem.pitch <= pi_2 or not -pi_2 <= telem.roll <= pi_2 +flipped = not -PI_2 <= telem.pitch <= PI_2 or not -PI_2 <= telem.roll <= PI_2 angle_to_horizon = math.atan(math.hypot(math.tan(telem.pitch), math.tan(telem.roll))) if flipped: angle_to_horizon = math.pi - angle_to_horizon