point

Draw line between two points using OpenLayers

你。 提交于 2019-12-18 19:38:10
问题 I have two points having lolLat as 0,10 and 30,0 Now to draw a marker at this point i use this transform while generating marker for it lonLat.transform( new OpenLayers.Projection("EPSG:4326"), // transform from WGS 1984 map.getProjectionObject() // to Spherical Mercator Projection ) How can i draw line between them is there any way to do that in openlayers,i have tried doing it with linestring in vector layer but it doesn't seems to be working for me. 回答1: For example: map = new OpenLayers

Multiple entry points to a storyboard

好久不见. 提交于 2019-12-18 12:43:03
问题 I need to make a set of decisions in the AppDelegate on launch - depending on the outcome of those decisions I need to go to specific parts of the storyboard. So my question is - WITHOUT using any nav or tab controllers, how do I go to a specific part of a storyboard? OR Is the only supported option having multiple storyboards - for each of the 'outcomes' and then loading those as required? Thanks 回答1: Give each of your ViewControllers a separate ID, and then instantiate the required one with

Lon/Lat Order when using spatial POINT type with MySQL

♀尐吖头ヾ 提交于 2019-12-18 07:43:46
问题 What is the correct order when setting a POINT in MySQL? Even the answers in SO questions differ on this: Moving lat/lon text columns into a 'point' type column Is it POINT(lat lon) or POINT(lon lat) As far, as i see it, it should be the first version (lat lon) as the POINT takes as params x and y, but i was not able to find an definite evidence. 回答1: as one can see here https://stackoverflow.com/a/5757054/1393681 the order is (lon lat). lon is basicly the y axis and lat the x if i look at my

Retrieve a positive or a negative angle from 3 points

醉酒当歌 提交于 2019-12-18 04:21:07
问题 I am rotating points around a center point in 2D space. The points are the center point, the old mouse position, and the new mouse position. My rotation function works fine, and I can calculate the angle perfectly. But I want to calculate a negative angle if the user is moving their mouse in a direction which should be interpreted as counter-clockwise. For example, moving the mouse toward the right (positive x-axis) should rotate clockwise if you are above (less than) the y value of the

Java: getting a value from an array from a defined location

孤街醉人 提交于 2019-12-17 21:22:10
问题 I have an array of numbers and would like to retrieve one of the values from location "index". I've looked at the Java documentation http://java.sun.com/j2se/1.5.0/docs/api/java/lang/reflect/Array.html but my code still isn't compiling. here is my method: public class ConvexPolygon implements Shape { java.awt.Point[] vertices; public ConvexPolygon(java.awt.Point[] vertices) { this.vertices = vertices; this.color = color; this.filled = filled; } java.awt.Point getVertex(int index) { Point

Algorithm for generating a triangular mesh from a cloud of points

こ雲淡風輕ζ 提交于 2019-12-17 17:32:30
问题 In some simulation program we generate object surfaces in terms of points, each point has 3D coordinates and the vector that represents the normal to the surface at that point. For visualization purposes we would like to generate a mesh composed of triangles; each three close points form one triangle with its normal. Then we can send this information to some standard visualization programs that render the surface like VMD (Visual Molecular Dynamics). We wonder which is the fastest/available

How can I label points in this scatterplot?

狂风中的少年 提交于 2019-12-17 15:34:13
问题 Can you help me on putting labels on the following graph? The code i use is: valbanks<-scan("banks.txt", what=list(0,0,""), sep="", skip=1, comment.char="#") valbanks valj2007<-valbanks[[1]] valj2009<-valbanks[[2]] namebank<-valbanks[[3]] percent_losses<-(valj2009-valj2007)/valj2007 percent_losses abs_losses<-(valj2007-valj2009) abs_losses plot(abs_losses, percent_losses,main="Absolute Losses vs. Relative Losses(in%)",xlab="Losses (absolute, in miles of millions)",ylab="Losses relative (in %

Python: checking if point is inside a polygon

廉价感情. 提交于 2019-12-17 15:22:25
问题 I have a class describing a Point (has 2 coordinates x and y) and a class describing a Polygon which has a list of Points which correspond to corners (self.corners) I need to check if a Point is in a Polygon Here is the function that is supposed to check if the Point in in the Polygon. I am using the Ray Casting Method def in_me(self, point): result = False n = len(self.corners) p1x = int(self.corners[0].x) p1y = int(self.corners[0].y) for i in range(n+1): p2x = int(self.corners[i % n].x) p2y

Distance between point and a line (from two points)

落爺英雄遲暮 提交于 2019-12-17 10:52:14
问题 I'm using Python+Numpy (can maybe also use Scipy) and have three 2D points (P1, P2, P3); I am trying to get the distance from P3 perpendicular to a line drawn between P1 and P2. Let P1=(x1,y1) , P2=(x2,y2) and P3=(x3,y3) In vector notation this would be pretty easy, but I'm fairly new to python/numpy and can't get anythng that works (or even close). Any tips appreciated, thanks! 回答1: Try using the norm function from numpy.linalg d = norm(np.cross(p2-p1, p1-p3))/norm(p2-p1) 回答2: np.cross

Distance between point and a line (from two points)

独自空忆成欢 提交于 2019-12-17 10:51:11
问题 I'm using Python+Numpy (can maybe also use Scipy) and have three 2D points (P1, P2, P3); I am trying to get the distance from P3 perpendicular to a line drawn between P1 and P2. Let P1=(x1,y1) , P2=(x2,y2) and P3=(x3,y3) In vector notation this would be pretty easy, but I'm fairly new to python/numpy and can't get anythng that works (or even close). Any tips appreciated, thanks! 回答1: Try using the norm function from numpy.linalg d = norm(np.cross(p2-p1, p1-p3))/norm(p2-p1) 回答2: np.cross