coordinates

Coverting list of Coordinates to list of tuples

强颜欢笑 提交于 2019-12-10 17:55:46
问题 I'm trying to covert a list of coordinates to a list of tuples: from: a_list = ['56,78','72,67','55,66'] to: list_of_tuples = [(56,78),(72,67),(55,66)] I've tried doing a for, in loop to convert each element in a_list to a tuple however the output is in the form: list_of_tuples = [('5', '6', '7', '8'), ('7', '2', '6', '7'), ('5', '5', '6', '6')] Any help on what I am doing wrong here would be greatly appreciated. EDIT: Fixed the expected output, no spaces between coordinates and tuples. 回答1:

MouseListener called multiple times

青春壹個敷衍的年華 提交于 2019-12-10 17:38:54
问题 I am using this code to get the X and Y coordinates of an image placed as icon of a jLable. This method to get the coordinates was suggested by an answer to this question. private void lblMapMouseClicked(java.awt.event.MouseEvent evt) { lblMap.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { double X = e.getX(); double Y = e.getY(); System.out.println("X: " + X + "Y: " + Y ); } }); } When I run this public void mouseClicked(MouseEvent e) { } gets called multiple

CSS breadcrumbs with clip-path - need of “negative” coordinates

喜你入骨 提交于 2019-12-10 17:16:38
问题 I'm trying to make a breadcrumbs path using clip-path . #clip span { padding: 3px 20px; background-color: #666; color: white; display: inline-block; clip-path: polygon(0 0, 90% 0, 100% 50%, 90% 100%, 0 100%, 10% 50%); } <div id="clip"> <span>hello</span><span>tiny</span><span>world</span><span>welcome!</span> </div> which gives While I like the simplicity of that method, the problem comes from the coordinates 90% , which are relative to the length of the word. Thus "welcome!" does not have

Android - display in the map only the markers included in a determinate area

隐身守侯 提交于 2019-12-10 16:14:46
问题 I have my application with a map. In this map i put a marker in the current location of the device. I also add a circle around the marker as follow: Circle circle = mMap.addCircle(new CircleOptions() .center(latLng) .radius(400) //The radius of the circle, specified in meters. It should be zero or greater. .strokeColor(Color.rgb(0, 136, 255)) .fillColor(Color.argb(20, 0, 136, 255))); The result is something like this: here's an example of the result! I have a database with some positions

Converting LLA to XYZ

只谈情不闲聊 提交于 2019-12-10 16:09:14
问题 Can you help me to convert lla to xyz coordnates. I am using earthRadius = 6378.137; var x = earthRadius * Math.cos(lat)*Math.cos(lon); var y = earthRadius * Math.cos(lat)*Math.sin(lon); var z = earthRadius * Math.sin(lat); this method to convert to xyz coordinates. But it does not give the correct result I want. Earth is defined as wgs84 object. 回答1: I solved my problem Lat Long to X Y Z position in JS .. not working this formula is the correct one. Thanks for Stephen Quan for answering this

UIImage in the end of UILabel text

▼魔方 西西 提交于 2019-12-10 15:55:06
问题 how to find coordinate of the last character in UILabel if we have more then 1 line of text in it? I would like to add an image in the end of the text. 回答1: I think you are looking for NSTextAttachment // create an NSMutableAttributedString let fullString = NSMutableAttributedString(string: "Your text") // create our NSTextAttachment let imageAttachment = NSTextAttachment() imageAttachment.image = UIImage(named: "icon") // wrap the attachment in its own attributed string so we can append it

How to rotate an object defined by x y z points around the x y or z axis

假如想象 提交于 2019-12-10 14:39:09
问题 I'm working with a program where I visualize molecules. The molecules are represented by multiple x, y, and z values for each atom. What I would like to be able to do, is some math on each coordinate and have the resulting molecule be rotated on one of the axis. I've tried using these formulas: y' = y*cos q - z*sin q z' = y*sin q + z*cos q x' = x and the corresponding ones for Y and Z axis. In rotations of 180 degrees, the resulting molecule looks fine, but appears to be the enatiomer (mirror

How to find Black Pixel locations

蹲街弑〆低调 提交于 2019-12-10 14:10:43
问题 I'm working on a strange project. I have access to a laser cutter that I am using to make stencils (from metal). I can use coordinates to program the machine to cut a certain image, but what I was wondering was: how can I write a program that would take a scanned image that was black and white, and give me the coordinates of the black areas ? I don't mind if it gives every pixel even though I need only the outer lines, I can do that part. I've searched for this for a while, but the question

get coordinates of drawn feature in OpenLayers

拥有回忆 提交于 2019-12-10 13:44:54
问题 I'm trying to create an online map using OpenLayers 3. I'm brand new to using OpenLayers, and all I'm trying to do is to get the coordinates of the points, lines, polygons that I drew on the map. I'm aware that there is a featuresadded parameter available, but I'm not able to implement it correctly. Can anybody point me in the right direction how to get the coordinates of a drawn feature (either in an alert() or console.log)? Thanks a ton!! here's my code: <html> <head> <script src="http:/

GPS coordinates accuracy

自作多情 提交于 2019-12-10 13:26:21
问题 I have some data with GPS coordinates with upto 9 decimal points. Example of this is 39.1234567891 -75.1987654321 I need to process this data to get a context of where the person is. But I want to treat the coordinates encompassed within 100m as a single location for simplicity. Can anyone point to any reference that would indicate how many decimal points I should round off to get to this level of accuracy. 回答1: 9 digits is too detailed for any but a long term geodetic app. 6 digits is in