IFD:EAI SoS21/course material/Session 3: File Structuring, Pointers and Addresses: Difference between revisions
From Medien Wiki
Line 2: | Line 2: | ||
Here are the solutions of last week's task. | Here are the solutions of last week's task. | ||
Please try a little to solve on your own, before you peek in here! :) | Please try a little to solve on your own, before you peek in here! :) | ||
To get the distance between two points on a 2D plane we can use the Pythagorean theorem as depicted in the picture below. We give coordinates to the points and use the coordinates to calculate the distance according to the formula c = sqrt( (x2-x1)^2 + (y2-y1)^2 ), where c is the distance between the two points. | |||
[[File:distance_calc.png|800px]] | [[File:distance_calc.png|800px]] |
Revision as of 14:55, 26 April 2021
Homework/Recap from Session 2:
Here are the solutions of last week's task. Please try a little to solve on your own, before you peek in here! :)
To get the distance between two points on a 2D plane we can use the Pythagorean theorem as depicted in the picture below. We give coordinates to the points and use the coordinates to calculate the distance according to the formula c = sqrt( (x2-x1)^2 + (y2-y1)^2 ), where c is the distance between the two points.