How to "correct" the roundness of the earth leading to ellipsis instead of circle in react leaflet - leaflet

I'm trying to programatically "draw" a circle with multiple Marker with React leaflet.
I'm doing it with cosinus and sinus trying to calculate theirs coordinate from the center point ...
But the more I'm near the pole the more the circle is an ellipssis ... Is it a way to transform the calculus to take this into account ?
In this example I'm in Oulu (near the pole) If you just change the x var into '0' you'll notice that the markers are now in circle !
please see this CodePen

Because a Leaflet map is a projection of a sphere onto a flat map, distortions will happen near the poles. You want to project your spherical Lat/Lng into flat Points, calculate the marker placements in flat Points and then unproject the points back to spherical LatLng.

Related

Display Earth map in Azimuthal Equidistant Projection

I have to display the Earth's map in azimuthal equidistant projection, by giving the lattitude and longnitude as input in Matlab. I am using the eqdazim projection, but I am still getting the map with point (0,0) in the center. I want to be able to change the point that is the center if the circle map.
landareas = shaperead('landareas.shp','UseGeoCoords',true);
axesm ('eqdazim', 'Frame', 'on');
geoshow(landareas);
Also, I don't know how to change the radius of the image. I don't need the circle with the whole Earth but instead something about ~2000km radius around center point.
I need it in order to put its image on a dome. Below is a simple example with such a dome and random fragment of the Earth's surface. Keep in mind, that it's just an image that I cropped manually from large Mercator map.
I was hoping that I can use the Mapping Toolbox in order to get such a map automatically, by giving lattitude, longnitude and radius. I have all necessary data, which is:
Lattitude & Longnitude
The radius of the circle
I just don't know how can I get this part of Earth's map. I think I have to use the azimuthal equidistant projection. I just don't know how to do this in MATLAB/Mapping Toolbox.

How to get the intersection between the scatterred points and the circle?

I'm using canny edge detection to detect the edges of a rope and eliminate the background, then using morphological filters I'm filling these edges then thinning them to be in pixel size. The plot indicates the xy coordinates of the rope. What I need to do is to get the intersection of the scattered data (blue *) with the red circle (get the coordinates of Points (1,2,3,4).
Then I need to get the whole points coordinates from the point of intersection (point1,2,3,4) to the center,grouped as A,B,C,D.
The center of the circle, the origin of the axes, and the radius are all known.
I've tried some Matlab functions to get the four intersections points like
InterX,intersections
and also I tried to manually find the intersections
idx=find(y1-y2<eps);
but no method gives me the 4 intersection points.
Thank you in Advance
You'll need a thick circle. I presume (from your previous question) that the rope points are at contiguous integer coordinates. Using a thick circle (donut) with a width of 1 ensures you'll find at least one point in each rope end. Connected component analysis will then tell you which of these points belong to the same rope end.

How to draw bearing angle using leaflet

I want to draw bearing angle using leaflet, as input I have a marker on map and the user can enter an angle value from a custom interface(this angle matches the bearing angle), so I want to draw this bearing angle on map. How can I do that on map using leaflet plugins? Any help is appreciated.

Rotating an arbitrary polygon around its own center

I'm trying to find a way to rotate an arbitrary polygon around its own geometric center. It was drawn in a blackboard built with creating js.
I've been trying many approaches, but any of them has worked.
How can I accomplish it?
Find the geometric centre as the average of all the points' coordinates. Make all the points relative to this centre (such that the centre is (0,0)), then rotate them by the desired angle using a rotation matrix. You can then draw using these points.
This is assuming you have the coordinates of all the points.

Polygon creation in OpenModelica

While creating a regular polygon in the Icon/Diagram Layer in OpenModelica, I can understand that the origin is the centre/centroid of the polygon and the co-ordinates of the points of the polygon are calculated using the origin as a reference.
Can anyone tell me how the origin co-ordinate and the point co-ordinates of an irregular ploygon are generated in OpenModelica?
Each graphic shape has a bounding rectangle http://qt-project.org/doc/qt-4.8/qgraphicsitem.html#boundingRect. The center of this rectangle is used as an origin.
What do you want to achieve?