חישוב זוויות דינמי
נוסחה, קוד, ויזואליזציה: שלוש דרכים להבין את אותו מושג
חישוב נקודת קצה לזווית — שלושה ייצוגים של אותו רעיון
# Step 1: degrees → radians rad = angle_deg * math.pi / 180 # Step 2: x-coordinate (cosine) cx = vx + r * math.cos(rad) # Step 3: y-coordinate (sine) cy = vy + r * math.sin(rad)
שימו לב: הצבעים עקביים — θ בכחול, rad בכתום-צהוב, cos/cx בטורקיז, sin/cy בוורוד. אותו צבע בציור, בנוסחה ובקוד. החיבורים בין הייצוגים — זה מנגנון הלמידה.
מיפוי בין ייצוגים
כל שורה היא אותו דבר בשלוש צורות שונות:
| Math | Python Code | Visual (SVG) | Color |
|---|---|---|---|
| θ (degrees) | angle_deg |
Arc + degree label | |
| rad | rad |
(internal conversion) | |
| r (radius) | radius |
Green arm from vertex | |
| cos(θ) → cx | math.cos(rad) |
Teal dashed vertical drop | |
| sin(θ) → cy | math.sin(rad) |
Rose dashed horizontal line | |
| C (cx, cy) | (cx, cy) |
Violet endpoint dot |
מחשבון אינטראקטיבי
שנו את הערכים וראו את כל שלושת הייצוגים מתעדכנים יחד:
סוגי זוויות וזוויות משלימות
זוויות משלימות ל-180°
שתי זוויות על קו ישר שסכומן 180°. אם נתונה זווית α, המשלימה שלה היא 180° − α.
טבלת זוויות נפוצות
לחצו על שורה כדי לטעון אותה במחשבון למעלה:
| θ (deg) | rad | cos(θ) | sin(θ) | C (r=10) | סוג |
|---|
קוד Python מלא
הקוד המלא נמצא בקובץ dynamic_angle_calculation.py — הוא כולל 3 מצבי ויזואליזציה ותפריט אינטראקטיבי.
import math def calculate_endpoint(vertex_x, vertex_y, radius, angle_deg): """Calculate endpoint C for any angle in degrees.""" # Step 1: degrees → radians rad = angle_deg * math.pi / 180 # Step 2: x-coordinate via cosine cx = vertex_x + radius * math.cos(rad) # Step 3: y-coordinate via sine cy = vertex_y + radius * math.sin(rad) return round(cx, 2), round(cy, 2) # Run: python dynamic_angle_calculation.py
זכרו: הקוד הוא תרגום של הנוסחה הטריגונומטרית, לא מקור ההבנה. מישהו היה צריך לדעת ש-cx = vx + r×cos(θ) כדי לכתוב אותו. הערך של הקוד: פירוק הנוסחה לשלבים ניתנים לעקיבה, הרצה עם ערכים שונים, ואימות התוצאות.