geodesic-sphere

Algorithm for a geodesic sphere

南笙酒味 提交于 2021-02-06 05:39:55
问题 I have to make a sphere out of smaller uniformely distributed balls. I think the optimal way is to build a triangle-based geodesic sphere and use the vertices as the middle points of my balls. But I fail to write an algorithm generating the vertices. Answer in C++ or pseudo-code will be better. Example of a geodesic sphere: http://i.stack.imgur.com/iNQfP.png 回答1: Using the link @Muckle_ewe gave me, I was able to code the following algorithm: Outside the main() class Vector3d { // this is a

Algorithm for a geodesic sphere

风格不统一 提交于 2021-02-06 05:38:09
问题 I have to make a sphere out of smaller uniformely distributed balls. I think the optimal way is to build a triangle-based geodesic sphere and use the vertices as the middle points of my balls. But I fail to write an algorithm generating the vertices. Answer in C++ or pseudo-code will be better. Example of a geodesic sphere: http://i.stack.imgur.com/iNQfP.png 回答1: Using the link @Muckle_ewe gave me, I was able to code the following algorithm: Outside the main() class Vector3d { // this is a

Algorithm for a geodesic sphere

↘锁芯ラ 提交于 2021-02-06 05:36:06
问题 I have to make a sphere out of smaller uniformely distributed balls. I think the optimal way is to build a triangle-based geodesic sphere and use the vertices as the middle points of my balls. But I fail to write an algorithm generating the vertices. Answer in C++ or pseudo-code will be better. Example of a geodesic sphere: http://i.stack.imgur.com/iNQfP.png 回答1: Using the link @Muckle_ewe gave me, I was able to code the following algorithm: Outside the main() class Vector3d { // this is a

Splitting a string containing a longitude or latitude expression in perl

亡梦爱人 提交于 2020-01-24 15:11:45
问题 I retrieve data from the net containing real geodesic expressions, by that I mean degrees, minutes and seconds with Unicode symbols: U+00B0, U+2032 and U+2033 , named Degree, Prime and Double Prime. Example: my $Lat = "48° 25′ 43″ N"; My objective is to convert such an expression first to degrees and then to radians to be used in a Perl module I am writing that implements the Vincenty inverse formula to calculate ellipsoidal great-circle distances. All my code objectives have been met with

Check if point is inside a circle

旧时模样 提交于 2020-01-11 10:46:09
问题 I have a point expressed in lat/long Position louvreMuseum = new Position( 48.861622, 2.337474 ); and I have a radius value expressed in meters. I need to check if another point, also expressed in lat/long, is inside the circle. If I were on a flat surface I can simply use the formula (x - center_x)^2 + (y - center_y)^2 <= radius^2 as deeply explained in these SO answer. However as per the latitude/longitude usage I can not use that formula because of the spherical nature of the planet. How

Check if point is inside a circle

我只是一个虾纸丫 提交于 2020-01-11 10:46:09
问题 I have a point expressed in lat/long Position louvreMuseum = new Position( 48.861622, 2.337474 ); and I have a radius value expressed in meters. I need to check if another point, also expressed in lat/long, is inside the circle. If I were on a flat surface I can simply use the formula (x - center_x)^2 + (y - center_y)^2 <= radius^2 as deeply explained in these SO answer. However as per the latitude/longitude usage I can not use that formula because of the spherical nature of the planet. How

New Xcode beta new problems: MKGeodesicPolyline

核能气质少年 提交于 2020-01-03 16:45:14
问题 The brand new Xcode version, in addition to removing a wide nume of place where to add an empty function call, introduced a funny problem with an simple piece of code drawing a geodetic path: func drawPolyline(from startLocation: CLLocation, endLocation:CLLocation) { let point1 = startLocation.coordinate let point2 = endLocation.coordinate var points: [CLLocationCoordinate2D] points = [point1, point2] var coordinates=points[0] let geodesic = MKGeodesicPolyline(coordinates: &coordinates, count

New Xcode beta new problems: MKGeodesicPolyline

依然范特西╮ 提交于 2020-01-03 16:44:35
问题 The brand new Xcode version, in addition to removing a wide nume of place where to add an empty function call, introduced a funny problem with an simple piece of code drawing a geodetic path: func drawPolyline(from startLocation: CLLocation, endLocation:CLLocation) { let point1 = startLocation.coordinate let point2 = endLocation.coordinate var points: [CLLocationCoordinate2D] points = [point1, point2] var coordinates=points[0] let geodesic = MKGeodesicPolyline(coordinates: &coordinates, count

Efficiently compute pairwise haversine distances between two datasets - NumPy / Python

限于喜欢 提交于 2019-12-11 01:30:38
问题 I want to calculate the geo-distance between latitude-longitude. I had checked this thread Vectorizing Haversine distance calculation in Python but when I am using it for two different set of coordinates, I m getting an error. df1 size can be in millions and if there is any other way to calculate accurate geo distance in less time then it would be really helpful. length1 = 1000 d1 = np.random.uniform(-90, 90, length1) d2 = np.random.uniform(-180, 180, length1) length2 = 100 d3 = np.random

Is the Azimuth on the equator equal to the one not on the equator?

穿精又带淫゛_ 提交于 2019-12-10 20:27:18
问题 I am trying to fully understand the concept of Azimuth and I am encountering some inconsistencies (or maybe it is my error). I show you some examples that do not match, hoping somebody can explain me how this really works. I show the coordinates in EPSG:900913, in PostGIS and using my own JavaScript function. MY FUNCTION /* Difference between the two longitudes */ var dLon = lon2 - lon1; /* Y value */ var y = Math.sin(dLon) * Math.cos(lat2); /* X value */ var x = Math.cos(lat1) * Math.sin