<jupyter_start><jupyter_text>Distance calculation based on circle theory  1.0 Theory--- A circle is a simple closed shape. It is the set of all points in a plane that are at a given distance from a given point, the centre; equivalently it is the curve traced out by a point that moves in a plane so that its distance from a given point is constant. The distance between any of the points and the centre is called the radius.  ![circle](./images/circle.png)A circle (black), which is measured by its circumference (C), diameter (D) in cyan, and radius (R) in red; its centre (O) is in magenta.  CircumferenceThe circumference of a circle is the distance around it, but if, as in many elementary treatments, distance is defined in terms of straight lines, this cannot be used as a definition. Under these circumstances, the circumference of a circle may be defined as the limit of the perimeters of inscribed regular polygons as the number of sides increases without bound. The term circumference is used when measuring physical objects, as well as when considering abstract geometric forms.When a circle's diameter is 1, its circumference is π.When a circle's radius is 1—called a unit circle—its circumference is 2π. Relationship with πThe circumference of a circle is related to one of the most important mathematical constants. This constant, pi, is represented by the Greek letter π. The first few decimal digits of the numerical value of π are 3.141592653589793 ... Pi is defined as the ratio of a circle's circumference C to its diameter d:![π relation](./images/pcd.svg)Or, equivalently, as the ratio of the circumference to twice the radius. The above formula can be rearranged to solve for the circumference:![circumference](./images/cpd.svg)When a circle's radius is 1—called a unit circle—its circumference is 2π.![circumference](./images/320px-2pi-unrolled.gif) Used Wikipedia for the theory and the images:[Circle Theory](https://en.wikipedia.org/wiki/Circle)[Circumference Theory](https://en.wikipedia.org/wiki/Circumference)  2.0 Experiment--- Its time to use Proteas for a experiment. First we need measure the diameter of a wheel and calculate the circumference.<jupyter_code>diameter = 6.6
circumference = diameter * 3.14
print(circumference)<jupyter_output>20.724<jupyter_text>Now we want to calculate how many revolutions of the wheels needed to make Proteas travel 15cm.<jupyter_code>revolutions = 15/circumference
print(revolutions)<jupyter_output>0.7237984944991315<jupyter_text>Let's make the Proteas to move!<jupyter_code>from proteas_lib import control
control.start_lib()
motor_a = control.motor(17,27,22)
motor_b = control.motor(10,11,9)
odometer_a = control.odometer(6)
print("Experiment start!")
odometer_a.reset()
motor_a.move()
motor_b.move()
while odometer_a.get_revolutions() < revolutions:
    print("I am moving..")    
motor_a.stop()
motor_b.stop()
print("Experiment completed!")
control.clean()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.07463694697737251, 'fraction_numerical': 0.0243161094224924, 'mean_word_length': 5.27542372881356, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '113745', 'license': 'MIT', 'n_tokens_mistral': 884, 'n_tokens_neox': 796, 'n_words': 376, 'path': 'source/notebooks/Courses/Distance calculation based on circle theory/Distance calculation based on circle theory.ipynb', 'repo_name': 'eellak/gsoc2019-diyrobot', 'size': '2961'}