coordinates

FInd the object from x,y in iOS

冷暖自知 提交于 2019-12-11 11:52:01
问题 How to find which UIElement is present in the window when (x,y) coordinates is given in iOS ? I will be having a view controller with many UI elements and I will be given x,y with which I have to find the element present in the view . 回答1: To get a list of views at a particular point you can use, -(NSArray*)subviewsAtPoint:(CGPoint)point inView:(UIView*)view { NSMutableArray *viewsAtPoint = [[NSMutableArray alloc]init]; for(UIView *subview in view.subviews) { if(CGRectContainsPoint(subview

calculate position of a point on image in percentage

允我心安 提交于 2019-12-11 11:41:00
问题 I am calculating position of a point on a image with the formula below in pixel, where oW is original image width and oH is original image height. var x = oW * parseInt(document.getElementById('pageX').value - $tagImage.offset().left - 5) / $tagImage.width(); var y = oH * parseInt(document.getElementById('pageY').value - $tagImage.offset().top - 5) / $tagImage.height(); Now, I want to calculate same position in percentage so that the point remains responsive. (Sorry, I am a bit weak in maths

GridLayout coordinates

こ雲淡風輕ζ 提交于 2019-12-11 10:46:59
问题 So I think you will understand my problem by this piece of code: int s = 4; int v = 4; world.setLayout(new GridLayout(s, v)); grid = new JLabel[s][v]; for (int x = s-1; x >= 0; x--) { for (int y = 0; y < v; y++) { grid[x][y] = new JLabel((x)+","+(y)); world.add(grid[x][y]); Now I get a grid with coordinates: 3,0 3,1 3,2 3,3 2,0 2,1 2,2 2,3 1,0 1,1 1,2 1,3 0,0 0,1 0,2 0,3 But I would like to get: 0,3 1,3 2,3 3,3 0,2 1,2 2,2 3,2 0,1 1,1 2,1 3,1 0,0 1,0 2,0 3,0 Any help appreciated.. 回答1: I didn

Gnuplot, how to invert x with y while plotting file data?

非 Y 不嫁゛ 提交于 2019-12-11 10:25:12
问题 I have a 'data.txt' file containing two columns and N rows, corresponding to N points, e.g. 0.2 0.3 0.4 0.6 0.1 0.7 0.9 0.6 If I use Gnuplot to plot data from this file, using the command plot "datafile.txt" with lp it plots every point in the default form (X, Y), that is Gnuplot interprets the first column as all the X values, and the second column as all the Y values. I would like to invert the meaning of X and Y. I would like to set Gnuplot this command: "Take the first column as Y, and

OpenLayers 3 Defining axis ordering

我与影子孤独终老i 提交于 2019-12-11 10:16:30
问题 I run into a problem that my GeoJSON return coordinates in a latitude/longitude order, but OpenLayers wants them to be in reversed order: longitude/latitude. And I cant't get them another way from server. Is it possible to reverse coordinates using OL3, like I found something about old OL like this formatOptions: { xy: false } Does something like this available in OL3? 回答1: The short answer is no. OL3 only accepts XY. If you have the possibility to reverse it in your GeoJSON source, do that.

Draw a line using buttons as a coordinates on a PictureBox

北慕城南 提交于 2019-12-11 10:07:07
问题 Currently I am making a searching program for Rooms/Office based on the image shown. I am having trouble on the program that I want show a line on the 2D map where buttons will be use to connect each coordinates of the line. But after searching a room no lines that will appear. private void button2_Click(object sender, EventArgs e) { System.Drawing.Pen myPen; myPen = new System.Drawing.Pen(System.Drawing.Color.Red, 5); System.Drawing.Graphics frmGraphics = pictureBox1.CreateGraphics(); if

Convert Google maps link to coordinates

て烟熏妆下的殇ゞ 提交于 2019-12-11 09:55:14
问题 How do I convert a Google maps link to GPS coordinates? (I think 10°11'12.0"N 13°14'15.0"E is an example of a common GPS coordinate format.) The reason I ask is that Google Maps for Android (I use Samsung Galaxy Note 3) does not seem to give coordinates. It will only give Google links. (Any instructions with right click can not be followed in a phone, only in a computer.) For example. How do I convert the following link to find the coordinates of the Eiffel Tower: http://goo.gl/maps/VqEsU I

Draw SVG image on paths but as big as needed

半世苍凉 提交于 2019-12-11 08:27:58
问题 So I would like to show an image on a path . The pathes are created via topojson coordinates. The points are on the right position on my map. So the next thing is to show a SVG image on that point. I tried that with appending svg:image , but no chance. I also tried to bring it into the path with the same result. I nowhere can see that image. Here an example with an PNG image. Because at least that should work to exclude SVG issues: var featureCollection = topojson.feature(currentMap,

Camera face detection coords to screen coords

一笑奈何 提交于 2019-12-11 08:17:03
问题 i've recently started playing with Android's camera api. And i'm using face detection and it's callback setFaceDetectionListener . I'm having trouble trying to understand how to convert the faces[0].rect.centerX(); and faces[0].rect.centerY() to something i can use on screen like move a image around the face centered on that point. can anyone help me understand how to convert from the coord system given by the camera to something i can use to set elements on my activity. 回答1: From docs (-1000

Generating a Cylindrical Surface with np.outer

↘锁芯ラ 提交于 2019-12-11 08:11:13
问题 I was able to previously generate and plot a spherical surface using np.outer: u = np.linspace(0, 2*np.pi, 100) v = np.linspace(0, np.pi, 100) x = R * np.outer(np.cos(u), np.sin(v)) y = R * np.outer(np.sin(u), np.sin(v)) z = R * np.outer(np.ones(np.size(u)), np.cos(v)) where x, y, z are of dim 100 x 100. See figure for result and ignore "particle traces" I understand the math and direction cosines of a sphere as well as cylinder so I think the confusion comes from not understanding what