I am trying to display a map of a city using lat/long coordinates from a .csv
file. These values have to be converted into x
and y
values in order to be displayed on the screen using Processing. My teacher gave me this code that does just this however for my coordinates the outputted map is rotated 90 degrees.
// 1. normalize the value between the minimum and maximum latitude or longitude values (new value between 0 and 1)
// 2. blow up the value between 0 and 1 by muliplying by the width or height of the screen (reduced by the margin 2 * 20 pixel)
// 3. shift the position by 20 pixel for the margin
float xPosition = 20 + (width-40) * norm(l.longitude, minLongCoord, maxLongCoord);
float yPosition = 20 + (height-40) * norm(l.latitude, minLatCoord, maxLatCoord);
Does anyone know how to rotate the x
and y
positions 90 degrees and in turn the outputted map from coordinates?
EDIT: The problem with translate is that if i have a mouse clicked function see what shape the mouse is over, the click and what shape the mouse is over are not aligned.