Given an ArcByCenterPoint, defined by:

- center position (lat,lon in WGS84)
- radius (meters)
- startAngle (degrees)
- endAngle (degrees)

how can we compute the position (lat, lon) of start/end points? I'm looking for a formula.

Given an ArcByCenterPoint, defined by:

- center position (lat,lon in WGS84)
- radius (meters)
- startAngle (degrees)
- endAngle (degrees)

how can we compute the position (lat, lon) of start/end points? I'm looking for a formula.

You can find appropriate formulas in the section **Destination point given distance and bearing from start point** here

Excerpt:

```
Formula:
φ2 = asin( sin φ1 ⋅ cos δ + cos φ1 ⋅ sin δ ⋅ cos θ )
λ2 = λ1 + atan2( sin θ ⋅ sin δ ⋅ cos φ1, cos δ − sin φ1 ⋅ sin φ2 )
where
φ is latitude, λ is longitude,
θ is the bearing (clockwise from north),
δ is the angular distance d/R;
d being the distance travelled, R the earth’s radius
```

lua,geometry,corona,geometry-surface

This sample from caronalabs.com forums shows how you might draw an arc, which provides the discrete algorithm you would need to do what you're asking: function display.newArc(group, x,y,w,h,s,e,rot) local theArc = display.newGroup() local xc,yc,xt,yt,cos,sin = 0,0,0,0,math.cos,math.sin --w/2,h/2,0,0,math.cos,math.sin s,e = s or 0, e or 360 s,e = math.rad(s),math.rad(e) w,h =...

Look at how it's done in the measure example for the geodesic measurement option: http://openlayers.org/en/v3.6.0/examples/measure.html var sourceProj = map.getView().getProjection(); var geom = /** @type {ol.geom.Polygon} */(polygon.clone().transform( sourceProj, 'EPSG:4326')); var coordinates = geom.getLinearRing(0).getCoordinates(); area = Math.abs(wgs84Sphere.geodesicArea(coordinates)); ...

ios,objective-c,geometry,calayer,uibezierpath

The problem is that you're using integers for your angles, but you're dealing with radians: - (void)createCircleWithStartAngle:(int)startAngle endAngle:(int)endAngle name:(NSString *)name; Use floating point (e.g. CGFloat) for your angles....

You can convert your coordinates to screen points using: http://leafletjs.com/reference.html#map-latlngtolayerpoint And then measure the distance between the two points with: http://leafletjs.com/reference.html#point-distanceto...

This can be done using border-radius . But you'll have to set equal height and width of the image and give border-radius only for top and right. Demo: http://jsfiddle.net/lotusgodkk/GCu2D/728/ CSS: img { border-radius:50% 50% 0 0; height:600px; //sample width:600px; //sample } HTML: <img src="http://www.lorempixel.com/600/600/sports/1/" /> In case of unequal width...

You are trying to inflate your shape, which has been answered before: inflate/deflate discussion...

algorithm,3d,geometry,distance,computational-geometry

Find affine transform M that translates this ellipse in axis-oriented one (translation by -p and rotation to align orientation vector r and proper coordinate axis). Then apply this transform to point p and check that p' lies inside axis-oriented ellipsoid, i.e. x^2/a^2+ y^2/b^2+z^2/c^2 <= 1

#include <cmath> // ... double angle = atan2(p2.y - p1.y, p2.x - p1.x); // ... If you want to, you can also make sure that p1 != p2, because if it is then you'll get a domain error....

javascript,openlayers,gis,map-projections

I can't get point projection by lat lon values, but solved it by adding projection property for each feature that will be added to the layer. my code is something like this: var mapProjection = new OpenLayers.Projection("EPSG:900913"); var dbProjection = new OpenLayers.Projection("EPSG:4326"); layer.preFeatureInsert = function (feature) { if (!feature.projection) feature.projection...

algorithm,geometry,computational-geometry,mesh,3d-model

If a 3D object is "simple", meaning that it doesn't have holes, it satisfies Euler's Formula for Polyhedra, V - E + F = 2 where V is the number of vertices in the figure, E is the number of edges, and F is the number of faces. If you...

algorithm,math,geometry,computational-geometry

The answer is to find the point that forms a triangle with sides lengths: Ra+Rb, Ra+Rc, Rb+Rc. That's known as solving by three sides, but you'll get 2 possible answers. The basic formula to use here is the law of cosines: c^2 = a^2 + b^2 - 2ab*cos(gamma) Let define...

sql-server,oracle,ssis,geometry

I'd bet dollars to donuts that you can use SSIS for this, with a little coercion. Specifically, well-known text (WKT) is the standard representation for geospatial data. On the Oracle side, you can use Get_WKT() against your data to return the WKT. Then on the SQL side, you can use...

It should be set as: map.fitBounds(bounds, { padding: [50, 50], maxZoom: 18, animate: true, pan: { duration: 10 } }); ...

jquery-ui,dictionary,slider,gis,leaflet

The answer to one thing that I get also all the polygons (30) designed on top of each other, even if I specify "showAllOnStart: false" is that you're adding geojson this way geojson = L.geoJson(geoJson, { style: style, onEachFeature: onEachFeature }).addTo(map); don't add addTo(map) at the end, simply do this...

matlab,image-processing,geometry,pixel,binary-image

Matlab is great for working with images thanks to the matrix syntax. It does also work with indices so most time you can avoid "iterating through pixels" (although sometimes you'll still have to). Instead of checking all the pixels within each circle, and having to detect how many pixels were...

Use polar coordinates: find an internal point to the polygon as a reference, say (c,d); use atan2(x-c, y-d) for each vertex (x,y) of the polygon to get the polar angles from that internal point; then sort by the angles you get. If the polygon is convex, averaging the max and...

actionscript-3,geometry,displayobject,angles

const radiance:Number=180/Math.PI; angle=-(Math.atan2(mouseX-panel.x, mouseY-panel.y))*radiance; I used minus because usually the orientation is reverse when you don't add minus. hope this helps....

merge,three.js,geometry,selection,octree

When setting up your octree make sure undeferred is set to true. Like this - octree = new THREE.Octree( { undeferred: true, depthMax: Infinity, objectsThreshold: 8, overlapPct: 0.15 } ); That should do the trick!...

javascript,geometry,computational-geometry,famo.us

Just play with 60 deg === PI/3: http://jsfiddle.net/coma/nk0ms9hb/ var circles = document.querySelectorAll('div.circles > div'); Array.prototype.forEach.call(circles, function (circle, index) { var angle = index * Math.PI / 3; circle.style.top = Math.sin(angle) + 'em'; circle.style.left = Math.cos(angle) + 'em'; }); I'm using ems to ease the calculations like 2 * radius ===...

It looks like you are trying to use ST_Contains on geography types, but that function only works on geometry types. If you are OK with the intersects spatial relation (see DE-9IM), then use ST_Intersects(geography, geography)....

well, i found out that the function clickpoly and used: polygon <- clickpoly(add = TRUE, col = 2, lwd = 2) and used: poligon$bdry[[1]][1] poligon$bdry[[1]][2] to get the x,y points in the polygon...

merge,three.js,geometry,rendering,mesh

Use the matrix4 toolset for translation (and rotation if you want), then merge your geometrys: var geometry = new THREE.TorusGeometry( 11, 0.5, 16, 100 ); var mergeGeometry = new THREE.Geometry(); var matrix = new THREE.Matrix4(); for( i = 1; i <= 50; i++ ) { matrix.makeTranslation( 0, 3.4 * i,...

c++,geometry,quaternions,euler-angles

The quaternions -q and q are different; however, the rotations represented by the two quaternions are identical. This phenomenon is usually described by saying quaternions provide a double cover of the rotation group SO(3). The algebra to see this is very simple: given a vector represented by quaternion p, and...

Putting quotes around POINT should resolve the error. ie: [Centr].STDistance('POINT (51.308316 -0.779919)') As for not getting correct results back, I would add the schema and some sample data so we can take a look....

opengl-es,geometry,opengl-es-2.0

The problem is when you add the points to the final arrays: for(int c1 = 0; c1 < points.size(); c1 += 3) { sphereVertices[c1] = points.get(c1)[0]; sphereVertices[c1+1] = points.get(c1)[1]; sphereVertices[c1+2] = points.get(c1)[2]; } instead of using the same index for both the array and the list us separate ones: for(int...

Yes it is possible if you set correctly the style for markers (without using an image): new ol.style.Style({ text: new ol.style.Text({...... Look at the following working example: http://jsfiddle.net/pfavero/yabta24t/13/ ...

math,javafx,geometry,coordinates

You can use the Math.atan2(dy, dx) to get the angle theta from the conversion of rectangular coordinates (x, y) to polar coordinates (r, theta). Later use it to convert it to degrees. import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.layout.StackPane; import javafx.scene.shape.Line; import javafx.stage.Stage; public class Main extends Application {...

gis,openstreetmap,overpass-api

That's a bad example, relation 3797211 doesn't have any forward or backward roles. Anyway, I don't think that's possible. Overpass API can only return complete elements. It can't remove specific roles from a relation, this has to be done in a post-processing step....

I would use the mid-point circle algorithm and see the array as a bitmap. I did this JavaScript implementation a while back, modified here to use an array as target source for the "pixel". Just note that a circle will produce odd widths and heights as the distance is always...

The trouble is, it is not clear what your 2D point is, what you want the sub-square value as, etc. So a definitive answer is difficult. But anyway, I will make some assumptions and see if I am right about what you are asking... Assuming you had a point A...

you can test for line intersections this is O(n^2) with naive approach if you segmentate the lines into segments then the complexity became much better see Implementing Hoey Shamos algorithm with C# for this and other approaches in better complexities then O(n^2) you can exploit periodicity of loop closed...

c++,math,rotation,grid,geometry

float x_old = p.x; float y_old = p.y; p.x = x_old * cos(a) - y_old * sin(a); p.y = x_old * sin(a) + y_old * cos(a); Of course, if you are rotating many points by the same angle, you will want to save the sin & cos, instead of calculating...

mapping,gis,mapbox,mapbox-gl-js

Take a look at this fiddle. You can use a function like: function jumpTo(index){ map.setView(positions[index], 4, { pan: { animate: true, duration: 2 }, zoom: { animate: true } }); } And control it on moveend event....

My error was that I was assuming that the center of the inverted circle also respected OP x OP' = r2, but as the image below shows, it clearly does not. The solution was to calculate two points on the circle and reflect each one, then use half the distance...

ndvi1[mergedmask==False].argmin() will give you the index of the minimum in ndvi1[mergedmask==False], i.e., the index into a new array, corresponding to the places where mergedmask is False. The problem here is that ndvi1[mergedmask==False] isn't really a mask. It selects those values of ndvi1 which meets the condition, and assembles those values...

This is how I'm loading the data now, "data" is my GJson var wktTraffic = new ol.source.Vector({ }); var trafficLayer = new ol.layer.Vector({ source: wktTraffic, style: new ol.style.Style({ stroke: new ol.style.Stroke({ color: 'blue', width: 5 }) }) }); function showData(data) { var format = new ol.format.WKT(); var feature; $.each(data, function...

The angle function returns the angle between the two vectors. For example if one vector was a unit vector pointing left and the other was a unit vector pointing up then the angle would be 90 degrees. In the first case, the first vector (0, 0) does not have an...

c++,geometry,rounding,cgal,convex

In the end I discovered the root of this problem was the fact that the convex hull contained lots of triangles, whereas my input shapes were often cube-shaped, making each quadrilateral region appear as 2 triangles which had extremely similar plane equations, causing some sort of problem in the algorithm...

javascript,geometry,2d,spatial,perspective

The perspective transformation you are describing is called foreshortening and I do suggest not only looking at my answer but also looking up more info on it because it is concept with various applications and can be solved for with varying methods. Keep in mind Javascript is not my forte...

I've made three tests. First and second are pure ol3 and last is with tween.js. I'm using Arc.js to create a path. The first example is using setInterval. The second example is using window.requestAnimationFrame. And the last with Tween.js. Your example doesn't run smoothly because it is just a few...

javascript,canvas,rotation,geometry

You could manually implement a transformation matrix. This allows you to set up the matrix for both read and write, then apply it to the points returning absolute points with the new actual values without the need or hassle to make special code for each use-case. The formula for the...

I learned this answer elsewhere: I had to type install.packages("gpclib", type="source") and it worked just fine. ...

math,geometry,line,pseudocode,angle

Let's define some notation: A := (a1, a1). B := (b1, b2). C := (c1, c2). Then the determinant D of the matrix 1 a1 a2 1 b1 b2 1 c1 c2 determines whether C lies left or right of the directed line AB [cf. Computational Geometry - Berg, van...

You can calculate 2d vectors cross product and look at its sign. Given two vectors v1 and v2 you can calculate 2d cross product as (v1.X*v2.Y) - (v1.Y*v2.X) If you have point (x, y) and line (x0, y0)-(x1, y1) then ((x-x0)*(y1-y0)) - ((y-y0)*(x1-x0)) is 2d vector cross product. It will...

First, find the point at which the circle is touching the rectangle. You can do this by working out the angle of one of the long rectangle edges that is parallel with the line from the center of the circle to the point where it touches the rectangle. Take the...

python,geometry,networkx,sympy

I found a solution that sped the process up by about 13x (for a polygon with 35 points (like the data listed above), the old method from the code in the question took about 4hours to find all line segments inside the polygon. This new method took 18 minutes instead.)...

This is what the code is doing. Every point P in the segment AB can be described as: P = A + u(B - A) for some constant 0 <= u <= 1. In fact, when u=0 you get P=A, and you getP=B when u=1. Intermediate values of u will...

android,algorithm,geometry,figure

You can make a method that takes in an angle and returns the point on the boundary at that angle from the center. This involves a little trigonometry, and cases for the square. To draw a line between the boundaries of two shapes, determine the angle of the difference vector...

p01 and p02 are center coordinates (CenterX and CenterY) d01-d04 represent cosine and sine of rotation angle (or dx,dy components of unit-length direction vector) l01 and l02 are half-width and half-height of initial axis-aligned rectangle. sxi and syi are X and Y-coordinates of ith vertice. These coordinates are rounded toward...

c++,matrix,rotation,geometry,axis

OK, I'm going to take another stab at this. My first answer was for XYZ order of rotations. This answer is for ZYX order, now that I know more about how MathGeoLib works. MathGeoLib represents position vectors as column vectors v = [x y z 1]^T where ^T is the...