<jupyter_start><jupyter_text>Measuring angles![](img/annotatedSandAngle.jpg)What is the measure in degrees of an angle of one radian?We want to draw a circular sector corresponding to an angle whose measure is one radian. DiscussionGiven an arc of a circumference having radius $r$ and length $s$, the measure in **radians** of the angle $\theta$ subtended at the center of the circle by an arc with a length $s$ is given by the ratio between the length of the arc and the length of the radius.\begin{equation*}\theta = \dfrac{s}{r}\end{equation*}> One radian is the angle subtended at the center of the circle by an arc with a length equal to the radius of the circle>> (Young and Freedman, University Physics with Modern Physics in SI Units)* A complete revolution corresponds to an angle of $2\pi$ **radianti**, or $360$ **degrees**.* The measure in radians is related to the measure in degrees through the equation\begin{equation*}\dfrac{\theta_{rad}}{2\pi} = \dfrac{\theta °}{360°}\end{equation*}from which\begin{equation*}\theta ° = \theta_{rad} \dfrac{180 °}{\pi}\end{equation*} Calculations with Python Converting measures from radians to degrees<jupyter_code>import numpy as np
from IPython.display import display, Markdown

theta_rad = 1
theta_deg = theta_rad * 180/np.pi

print()
display(Markdown(r'$\theta_{rad}$'+' = '+ str(theta_rad) + ' **rad**\n'))

display(Markdown(r'$\theta_{deg}$'+' = '+ str(theta_deg) + ' **deg**\n'))
print()

Markdown("""
Values of the angle measured in radians and corresponding value measured in degrees, with three decimal figures,\n
|&theta; rad |&theta; deg|
|-------|-------|
|{one}|{two:0.3f}| 
""".format(one = theta_rad, two = theta_deg))<jupyter_output><jupyter_text>&nbsp;> If you want to run the Python code in the **binder** environment online,[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/POSS-UniMe/simple-physics-with-Python/HEAD)&nbsp; Graphical representation<jupyter_code>import numpy as np
import matplotlib.pyplot as plt
from matplotlib import patches
from matplotlib.patches import Wedge

xcenter, ycenter = 0., 0.
width, height = 2.01, 2.01

beta = 1 # radians
beta_deg = beta * 180/np.pi

fig1 = plt.figure(1, (5,5))
arc = patches.Arc((xcenter,ycenter),width,height,angle = 0.0, theta1 = 0.0, theta2 = 360.0, color = 'blue', linewidth = 1.5)
ax = fig1.add_subplot(111, aspect='equal')
plt.xlim(-1.1, 1.1)
plt.ylim(-1.1,1.1)
plt.plot(0,0, 'o', markersize = 4, color = 'blue')
ax.add_patch(arc)

radius = 1
wedge = Wedge((xcenter,ycenter),radius, 0, beta_deg)
ax.add_patch(wedge)
plt.text(0.75,0.75,r'$\theta$ = {0:0.3f} deg'.format(beta_deg), fontsize='16')
plt.axis('off')
plt.show()<jupyter_output><empty_output><jupyter_text>Get a feel ofGiven an angle 𝛾 whose value, measured in degrees, is in the range between 0 and 360, calculate the value measured in radians.Draw a circular sector corresponding to the angle chosen above.&nbsp;<jupyter_code>import ipywidgets as widgets
from IPython.display import display, Markdown, HTML

style = {'description_width':'initial'}
sliderAngle = widgets.FloatSlider(min = 0, max = 360, step = 1, value = 45,
                                  description ='Angle '+r'$\gamma$'+' (°)', style = style, continuous_update=False)
print()

def calculate(gamma):
    gamma_rad = gamma * np.pi/180   # angle (radians)
    gamma_over_pi = gamma/180       # angle (fraction of pi radians)
    display(HTML('\n &gamma; = {0:0.3f} <b>rad</b> = {1:0.3f} &pi; <b>rad</b>'.format(gamma_rad, gamma_over_pi)))
    makeplot(gamma)

def makeplot(gamma):
    fig2 = plt.figure(2, (5,5))
    arc = patches.Arc((xcenter,ycenter),width,height,angle = 0.0, theta1 = 0.0, theta2 = 360.0, color = 'blue', linewidth = 1.5)
    ax = fig2.add_subplot(111, aspect='equal')
    plt.xlim(-1.1, 1.1)
    plt.ylim(-1.1,1.1)
    plt.plot(0,0, 'o', markersize = 4, color = 'blue')
    ax.add_patch(arc)
    
    radius = 1
    wedge = Wedge((xcenter,ycenter),radius, 0, gamma)
    ax.add_patch(wedge)
    plt.text(0.75,0.75,r'$\theta$ = {0:0.3f} deg'.format(gamma), fontsize='16')
    plt.axis('off')
    plt.show()
 
widgets.interact(calculate, gamma = sliderAngle)<jupyter_output>
{'fraction_non_alphanumeric': 0.15390138822403063, 'fraction_numerical': 0.033748204882719006, 'mean_word_length': 4.542440318302387, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 19, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '319725', 'license': 'CC-BY-4.0', 'n_tokens_mistral': 1561, 'n_tokens_neox': 1441, 'n_words': 421, 'path': 'Chapter03/Section01/3-1-1-Trigonometry.ipynb', 'repo_name': 'POSS-UniMe/simple-physics-with-Python', 'size': '4178'}