Coordinate Systems
📖 Scenario: You are working with a simple map of a city park. The park has several landmarks, and you want to store their positions using coordinates.
🎯 Goal: Create a list of landmarks with their x and y coordinates, set a reference point, calculate the distance of each landmark from the reference point, and print the distances.
📋 What You'll Learn
Create a list called
landmarks with named vectors for each landmark's x and y coordinatesCreate a variable called
reference_point as a named vector with x and y coordinatesCalculate the Euclidean distance from each landmark to the
reference_point using a for loop and store results in a vector called distancesPrint the
distances vector💡 Why This Matters
🌍 Real World
Coordinate systems help us locate places on maps, in games, or in real life, like finding landmarks in a park.
💼 Career
Understanding coordinates and distance calculations is useful in fields like geography, game development, robotics, and data visualization.
Progress0 / 4 steps