coordinates

VB.NET - Mouse Coordinates

纵饮孤独 提交于 2019-12-02 09:35:56
问题 I have a vb.net application, and I want to know how to find the coordinates of the pointer (mouse) when it is clicked on the form. Not much else to say, so I'll leave it like that.. :D Thanks 回答1: Very simple code to put the mouse coords in a text box Private Sub Form1_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseClick Dim MPx As Point = MousePosition() TextBox1.Text = MPx.ToString End Sub tried and tested, 回答2: I believe you are looking

SpriteKit Coordinates differ between iPad and iPhone

馋奶兔 提交于 2019-12-02 09:20:15
I have a very simple SpriteKit scene that is not behaving like I would expect. It is a universal app and the code that I am using to draw a single red square in the scene is as follows: let redSquare = SKSpriteNode(color: UIColor .redColor(), size: CGSizeMake(100.0, 100.0)) redSquare.anchorPoint = CGPointMake(0.0, 0.0) redSquare.position = CGPointMake(1.0, 1.0) addChild(redSquare) This code is in the GameScene didMoveToView method of the default app that xCode creates for you when you select SpriteKit game. When run on the iPad it behaves as expected drawing the red square 1 point off the

How to remove points that are far from a segment?

耗尽温柔 提交于 2019-12-02 09:08:08
I read how to keep points that are between two points (ie. : that are part of a segment, with some imprecision) here : How can I tell if a point is nearby a certain line? Thus, I implemented this little algorithm in Java, and my code is (note that the variables' name should be clear for you ! :) ) : List<Cupple> returned = new ArrayList<>(points_to_test); for(Cupple c : points_to_test) { /*if(c == segment_first_point || c == segment_last_point) { continue; }*/ if(Math.abs(Math.abs( (segment_last_point.getNumber(0) - segment_first_point.getNumber(0)) * (segment_first_point.getNumber(1) - c

How to name the coordinates (points) in Java Swing

不问归期 提交于 2019-12-02 08:47:38
I'm designing an interface using java swing. There is a canvas for the user to draw shapes (circle, triangle, square, etc.). When the user draws a shape, I want to name each point in the shape alphabetically. I know how to get the coordinates but how do I name the points? Here is one way to do it. You use Character.toString(char) and use 'A'+offset to get any char from the alphabet. See in this small demo example, which draws polygons. Single click creates vertices of your polygon Double-click stores the current polygon and starts creating a new polygon Right-click clears the current polygon

How to calculate coordinates of third point in a triangle (2D) knowing 2 points coordinates, all lenghts and all angles [closed]

本秂侑毒 提交于 2019-12-02 08:25:11
I have a triangle and I know the coordinates of two vertices: A=(x1,y1),B=(x2,y2) All the angles: ABC=90∘,CAB=30∘ and BCA=60∘ and all the edge lengths. How can I find the coordinates of the third vertex C=(x3,y3)? I know there are two solutions (I want both). You know p1 and p2. You know the internal angles. Make a ray from p1 trough p2, and rotate it CW or CCW 30° around p1. Make a line trough p1 and p2, and rotate it 90° around p2. Calculate the intersections. You get the points: x3 = x2 + s*(y1 - y2) y3 = y2 + s*(x2 - x1) and x3 = x2 + s*(y2 - y1) y3 = y2 + s*(x1 - x2) where s = 1/sqrt(3) ≈

Google maps - draw ellipse based off 4 coordinates

耗尽温柔 提交于 2019-12-02 08:01:24
I would like to draw an ellipse on google maps based off four coordinates, like the current "rectangle" method available via the API: var rectangle = new google.maps.Rectangle({ strokeColor: '#FF0000', strokeOpacity: 0.8, strokeWeight: 2, fillColor: '#FF0000', fillOpacity: 0.35, map: map, bounds: new google.maps.LatLngBounds( new google.maps.LatLng(33.671068, -116.25128), new google.maps.LatLng(33.685282, -116.233942)) }); (using the bounds paramater). If that fails, is there an easy way to convert the distance between 2 polygons to a unit of measurement? You have to calculate the path

Google Maps - Panning and Zooming into areas - markers not appearing when I zoom in or pan

独自空忆成欢 提交于 2019-12-02 07:52:30
问题 I'm implementing some boundary based clustering on the server end of markers to display on my google maps. What I'm doing is that I have a function that is called everytime the map is moves or panned or zoomed which takes the bound of the map and makes an ajax call which in turn the server side script runs a simple sql query to retrieve the markers and clusters them. SO far teh clustering part is working nicely however sometimes the getBounds doesn't seem to be sending the correct boundaries

Python, two dimensional list and coordinates

拜拜、爱过 提交于 2019-12-02 07:35:33
I have a two dimensional list: def list(): list1 =[1,2,3,4,5] list2 =[0,0,0,0,0] list3 =[6,7,8,9,10] list=[list1,list2,list3] for i in list: print(i) list() 6 will have the coordinates (0,2), right?? I want to move 6 to (0,1) and when I do that, I also want (0,2) to become 0. How do I do that? I have no idea.. I'm a beginner at this. Just assign directly to those two index pairs, indexing from the outer list to the inner (the last list is 2 , the middle list is 1 ), so the first element of the last list is at [2][0] : outerlist[1][0], outerlist[2][0] = outerlist[2][0], 0 This assigns two

Google Maps - Panning and Zooming into areas - markers not appearing when I zoom in or pan

天涯浪子 提交于 2019-12-02 07:20:37
I'm implementing some boundary based clustering on the server end of markers to display on my google maps. What I'm doing is that I have a function that is called everytime the map is moves or panned or zoomed which takes the bound of the map and makes an ajax call which in turn the server side script runs a simple sql query to retrieve the markers and clusters them. SO far teh clustering part is working nicely however sometimes the getBounds doesn't seem to be sending the correct boundaries I feel. Like I may pan a map a bit on the side and regions which used to have markers now all of a

Matrix / coordinate transformation in C#

混江龙づ霸主 提交于 2019-12-02 05:20:09
问题 I have an array of coordinates that reflect known positions on an image. Let's call this the template image. It has a unique barcode and orientation markers (which are also in the coordinate array). The image is printed, scanned and fed back into my application to be detected. During printing and scanning, the image could be transformed in three ways; translation, rotation and scale. Assuming that I can find the orientation markers on the distorted image, how can I use matrix transformation