FAQ Database Discussion Community


Working with coordinates x y

c++,function,structure,coordinates,circle
I need to read from a file coordinates of points. The file looks like this: x0 y0 x1 y1 .... Then find center and diameter of the smallest enclosing circle. But I stucked in the beginning. I don't know how to hold coordinates and decided to choose array of structures....

Coffeescript single co-ordinate of turtle

coffeescript,coordinates
I know that co=getxy() will store the x and y co-ordinates of the turtle as the variable co but is it possible to find and store just one of the co-ordinates. E.g. x OR y Any help is appretiated, as I cannot find any references to doing this. ->Alternatively, can...

How to sort string of numbers (x,y,z,x,y,..) w/ regular expressions?

regex,string,notepad++,coordinates
Is it possible to sort string of numbers using regular expressions? They are separated only by comma (,) the pattern is xx.xx,-yy.yy,zz.zz,-xx.xx,yy.yy,zz.zz,..., not necessarily 2 places before and after decimal point and possible minus sign. (I was hoping to use only primitive macro in Notepad++) Short excerpt: -50.0,-50.0,30.00012772,-47.47203563,-50.0,29.99892056,-44.94407125,-50.0,30.00167397,-42.41610688,-50.0,29.99915497,-37.31940443, ...

How to set coordinates for sprite correctly in Phaser?

jquery,coordinates,phaser-framework,phaser
I have a code: w = window.innerWidth * window.devicePixelRatio, h = window.innerHeight * window.devicePixelRatio; holdLeft = game.add.button(w/2.892, h/1.3092, 'holdLeft', this.holdLeft, this); And I have problems setting coordinates to this sprite, for example, I don't know exactly where this one should be and I need to think out some coordinates but...

Is it possible to get real time coordinates of an ImageView while it is in Translate animation?

android,imageview,coordinates,translate-animation
I have an image of a bullet in an ImageView that does Translate animation. I need to show real time coordinates to show how far it is from target in real time. ImageView myimage = (ImageView)findViewById(R.id.myimage); Animation animation = new TranslateAnimation(100, 200, 300, 400); animation.setDuration(1000); myimage.startAnimation(animation); animation.setRepeatCount(Animation.INFINITE); Is it possible...

Create and remove image at certain coordinates on android

android,layout,imageview,coordinates
I have an XML Relative layout, with just a few textviews and buttons on it. But I would like to place an image (or sometimes multiple copies of the image) at different x and Y coordinate which is worked out later on. Unfortunately I can't seem to figure out how...

get nearest coordinate from sqlite database

sqlite,coordinates,distance
I have a point coordinate based on two double values x0,y0 both in this format: xx.x (point as decimal separator) In a database I have a list of lines that are defined by the coordinates x1,y1 as startpoint and x2,y2 as endpoint. Among other columns, (such as line thickness and...

How could I compare two data sets of X,Y coordinates to look for similarities?

javascript,authentication,comparison,coordinates,gesture-recognition
Pretty abstract question, but I'm conducting some research on gesture-based recognition. I've managed to get the gesture to be outputted into a series of X,Y coordinates that I can view as a scatter graph: Here's my problem; I'm unsure on how to proceed. What is the best way to compare...

Java - Always 0?

java,math,coordinates,calculator
i have a normal Java code, that just calculate a x-coordinate, but it is just 0; private static final int startX = (Level.WIDTH / 2) - (Block.LENGTH * (Level.COLUMNS / 2)); At the time of calculating: Level.WIDTH = 1000; Block.LENGTH = 41; Level.COLUMNS = 12; Accord my calculation it must...

Co-ordinate of touch location is zero

swift,sprite-kit,coordinates
I am struggling to get the coordinates based on touch. For simplicity I have created a new Project using swift and a sprite kit game - the default spinning spaceship one. override func touchesBegan(touches: NSSet, withEvent event: UIEvent) { /* Called when a touch begins */ for touch: AnyObject in...

Python: how to get coordinates on mouse click using matplotlib.canvas

python,matplotlib,coordinates
I am writing a class to process images. In that class, I want to define a method that can allow me to return coordinates of the mouse clicks. I can get the coordinates as an attribute but if I call the method to return the coordinates, I get an empty...

OpenGL iOS screen coordinates to scene coordinates

ios,objective-c,opengl-es,coordinates,glkit
I'm using OpenGl to make a little Application and I have no idea how to get the x , y and z coordinates of a touch For example: -(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [touches anyObject]; CGPoint touchPoint = [touch locationInView:[self view]]; float X = touchPoint.x; float Y...

Have 2D sprite face 3d camera

javascript,c#,unity3d,sprite,coordinates
I'm creating a 3D game in Unity 5 but would like to use 2D sprites for certain parts. I'm quite new to Unity, so I might be missing something obvious. My camera's Y axis has been increased and the X axis rotated 90 degrees so that it's looking 'down' at...

Why won't this query return results that are 0?

mysql,coordinates
Using haversine, the following query finds all rows that have coordinates within a 10 mile radius of the inputted coordinates. SELECT * , ( 3959 * acos( cos( radians($locationLatitude) ) * cos( radians( endingLatitude ) ) * cos( radians( endingLongitude ) - radians( $locationLongitude ) ) + sin( radians( $locationLatitude)...

wxpython tooltip at specific coordinates

wxpython,tooltip,coordinates,paint
I have seen lots of similar questions and those answers are what has gotten me this far. I have an application where all all object are created via DC, so they are all all drawn. (I have had much experience with sizers and 99% of the time sizers ROCK but...

How to retrieve the coordinates of a Line2D in Java

java,line,coordinates,shape,rectangles
So am trying to retrieve the coordinates of a line 2D that i will draw on my JPanel. The getBounds() method seemed to work for a rectangle2D but is not appripriate for a line2D.. How can i get the the coordinates of a line2D and put them in a variable...

python from list of tuples, get tuple closest to a given value

python,list,tuples,coordinates
Given a list of tuples containing coordinates, I want to find which coordinate is the closest to a coordinate I give in input: cooList = [(11.6702634, 72.313323), (31.67342698, 78.465323)] coordinate = (11.6702698, 78.113323) takenearest(myList, myNumber) ... (11.6702634, 72.313323) Please let me know... Thanks in advance...

Draw SVG image on paths but as big as needed

javascript,svg,d3.js,coordinates,topojson
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....

Lookup algorithm that returns regions?

java,algorithm,coordinates,quadtree
I have a large list of regions with 2D coordinates. None of the regions overlap. The regions are not immediately adjacent to one another and do not follow a placement pattern. Is there an efficient lookup algorithm that can be used to let me know what region a specific point...

iTextSharp - Table in absolute coordinates

c#,table,itextsharp,coordinates,absolute
I am trying to use this tutorial to position table in absolute coordinates using iTextSharp. Here is my code: using System; using System.Collections.Generic; using System.Linq; using System.Text; using iTextSharp; using iTextSharp.text; using iTextSharp.text.pdf; using System.IO; namespace iTextSharpQuestion { class Program { static void Main(string[] args) { System.IO.FileStream fs = new...

ggvis input_select on scale_numeric trans parameter

coordinates,transform,ggvis
I'm really newbie to ggvis and I searched all over web without success. I have a dataset like this one: data.example=data.frame("V1"=c(rep("A",times=10),rep("B",times=10)),"V2"=c(runif(10,1,10000),runif(10,100,1000))) head(data.example) V1 V2 1 A 7261.076 2 A 1955.755 3 A 3473.473 4 A 7593.278 5 A 3218.867 6 A 4997.951 tail(data.example) V1 V2 15 B 721.2147 16...

Rotate line segment with Button

math,javafx,geometry,coordinates
I have a line which has points (x1,y1) and (x2,y2). I wanted to attach a Button to it, it should align with the line by rotating based on the line segment points. I need some help in calculating the rotation angle for the Button.

Convert DDM to DD Geographic Coordinate Conversion C# [closed]

c#,math,coordinates,converter,coordinate
I have used http://www.pgc.umn.edu/tools/conversion to convert 52 37.9418 N 01.18.8020 E (DDM I Think?) To Latitude 52.632363 Longitude 1.313367 This seems to be very accurate, i have played about with the calculations to convert these values myself but they never seem to be accurate. http://en.wikipedia.org/wiki/Geographic_coordinate_conversion Does anyone have a good...

Putting geolocation coordinates into array

javascript,html,arrays,geolocation,coordinates
I'm trying to put my geolocation coordinates gathered during watchPosition() into an array, so that I can work out total distance later. I have create a new array var mapArray; mapArray = new Array(); then where I assigning my latitude and longitude im putting the values to the array document.getElementById("currentLat").innerHTML...

Coordinates of a JTextPane to make a Screenshot in Java

java,swing,coordinates,screenshot,jtextpane
I hope some one can help me, this is what I want to do. I have a JTextPane and I want to take a screenshot to that specific JTextPane coordinates and size, so far I can do a screenshot with the size of the JTextPane but I can't get the...

How do I calculate the coordinates of the points of an helix?

java,math,geometry,coordinates,helix
The following code is called every 50ms. // Start point private double x; private double y; private double z; private double y1; @Override public void run() { double x1 = Math.cos(y1); double z1 = Math.sin(y1); double y2 = 4D - y1; double x2 = Math.sin(y2); double z2 = Math.cos(y2); //...

why is “+” added to all my coordinates in url builder?

java,string,url,format,coordinates
I have this code to build a string of coordinates: public String generateUrl(CompleteRoutingResponseShort completeRoutingResponse) { if (completeRoutingResponse == null) { return "CompleteRoutingResponse is null"; } UriBuilder builder = UriBuilder .fromPath(Constants.LIVEMAP_BASE_URL) .scheme("http"); builder.queryParam("lineGeom", getCoordsLists(completeRoutingResponse)); return builder.build().toString(); } private String getCoordsLists() { List<String> lists = new ArrayList<>(); for (AlternativeShort alternative :...

Speed up looping code for coordinate conversion

r,loops,coordinates
I have a data set of tree stems and their position, originally in plot-coordinates. I need to convert these coordinates to utm coordinates. I have written the following functions to convert our plot coordinates to utm coordinates and the following script to run this over the entire dataset. The problem...

Get SVG-Object_s at given coordinates?

svg,coordinates
I'd like to obtain object IDs from an SVG-file via coordinates. For example in <?xml version="1.0" encoding="UTF-8" standalone="no"?> <svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" version="1.1" height="50" width="50"> <rect id="rectRED" x="15" y="5" height="30" width="30" style="fill:#ff0000;fill-opacity:0.5;stroke:#000000;stroke-width:1.5" /> <rect id="rectBLUE" x="5" y="15" height="30" width="30" style="fill:#0000ff;fill-opacity:0.5;stroke:#000000;stroke-width:1.5" />...

Assigning variable in for loop to the x coordinate of each point in an arraylist

android,for-loop,arraylist,coordinates,variable-assignment
I'm trying to assign each x and y coordinate in my ArrayList to a variable as each coordinate will be compared to the coordinates of the point a user will click on the screen. // the coordinates of each point Point p1 = new Point(100, 100); Point p2 = new...

What is this algorithm mapping coordinates to numbers called?

algorithm,coordinates,coordinate-systems,coordinate
I'm writing a program for visualizing crystals. As a part of the program, I have to generate all different basic points in a lattice structure. For those that aren't familiar with crystallography, you can find the most general cases of these structures here: https://en.wikipedia.org/wiki/Hermann%E2%80%93Mauguin_notation#Lattice_types The problem was that I wanted...

Using the mouseClicked method in the JMapViewer does not update the getPosition return value

java,coordinates,mouselistener,mouseclick-event,jmapviewer
I have create a MouseInputAdapter listener to get coordinates in a JMapViewer map and create the MapMarker on that spot but even though I click on a different possition the value of the map.getPossition() method does not updates with the new values. My listener code: @Override public void mouseClicked(MouseEvent e)...

Move a whole enemy object to a new point

c#,unity3d,coordinates,unity3d-2dtools
In my code I am trying to check if the player dodges the obstacle and the obstacle goes to the x position of -13 (offscreen). If it does than it should reappear coming in with a random x and y coordinate. I get no errors it just doesn't do the...

Inverse Distance Weighting in R

r,csv,coordinates,interpolation
Trying to interpolate a set of data using IDW. I am able to bring in the csv and convert it to a spatial points data frame. My column headings are lat and lon instead of x and y. The coordinates are very minimal in distance due to the csv being...

Find inside coordinates of polygon in tile based map

java,awt,coordinates,polygon,java-2d
If I have all of the outer edges of polygons in a list how would I go about finding the inside coordinates?? To make matters simple I drew the following image to represent the problem: I need to find the inside of 'buildings' in a tilebased game. outside walls -...

Coordinate (x,y) list to be sort with a spiral algorithm

php,sorting,coordinates,spiral
I have a list of coordinate to be sorted with a spiral algorithm. My need is to start on the middle of the area and "touch" any coordinate. To simplify this is the representation of the (unsorted) list of coordinates (x,y marked with a "dot" on following image). CSV list...

Not allowing Google Maps api to place a marker more than once

javascript,html,google-maps,google-maps-api-3,coordinates
I have made a html file which is integrated with javascript which lets me retrieve data for an XML file and plot them coordinates automatically onto the map. It does this because I have a timer placed into the script to tick every 4 sec so that the map can...

C# WPF -> How to get the coordinates from a stretched(uniform) polygon on a grid

c#,wpf,coordinates,polygon
I searched a lot to find a solution for my problem. Couldn't find anything. This is what I do: I render a polygon via point array on a grid. The polygon autoresizing itself to match the grids size(uniform). I get the new stretched coordinates with the following lines and create...

Check if elements of different ArrayLists share position

java,arraylist,coordinates
I am programming a probe that moves through a 2D board in Java. To do this, I have two ArrayLists of Integer that contain the path that the probe has followed. The first ArrayList contains the x-coordinate, and the second one, the y-coordinate. What I would like to do is...

Project array content with mongodb

arrays,mongodb,mongoose,coordinates,geospatial
My problem is that when I'm using MongoDB 2D index for coordinates everything works just fine but the JSON output is not what I desire. var schema=new Schema({ location:{ type:[Number], // [<longitude>, <latitude>] index:'2d', required:false } }); **desired output** { "_id":"xxx", "longitude":18.056974411010742, "latitude":54.31120601701069, } **what i get** { "_id":"xxx", "location":[18.056974411010742,54.31120601701069]...

How to get pixel coordinates from canvas polygon (filled area)

javascript,html5,google-maps,canvas,coordinates
I am creating an interface that enables user to hightlight custom area in map with overlay canvas polygons. as in figure. then, I want to get all filled pixels from canvas with specified color so that I can transform that pixel values into geo LAT-LONG values. I want to create...

extracting coordinates from polygon r

r,coordinates,s4,slots,sp
I am trying to extract coordinates from numerous polygons, originally contained in a SpatialPolygons object: Sr1 = Polygon(cbind(c(2,4,4,1,2),c(2,3,5,4,2))) Sr2 = Polygon(cbind(c(5,4,2,5),c(2,3,2,2))) Srs1 = Polygons(list(Sr1), "s1") Srs2 = Polygons(list(Sr2), "s2") SpP = SpatialPolygons(list(Srs1,Srs2), 1:2) I am trying to extract the coordinates from Sr1 and Sr2 from the SpP object. I saw...

Get coordinates of multiple touches in Swift

ios,swift,coordinates
So I've been messing around trying to get the coordinates of touches on the screen. So far I can get the coordinates of one touch with this: override func touchesBegan(touches: NSSet, withEvent event: UIEvent) { let touch = touches.anyObject()! as UITouch let location = touch.locationInView(self.view) println(location) } But when touching...

How to connect two markers with a line in Google maps api3

javascript,html,google-maps,google-maps-api-3,coordinates
I have made a html file which takes data from an XML file and uses the data on it to plot two markers on a map is there any way I could connect these two markers which have no permanent position this is my code for the markers. <!DOCTYPE html>...

How to ignore black bars on fitviewport(LibGdx) when getting coordinates?

java,libgdx,touch,coordinates,viewport
I have a problem that can't resolve. I use a stage in my game with FitViewport style. stage = new Stage(new FitViewport(SCREEN_WIDTH, SCREEN_HEIGHT)); But there's a problem when I get the touchdown coordinates and black bars appear on screen (if the screen has the right ratio there's no problem). @Override...

Finding if lat/long point is inside a polygon defined by coordinates

php,codeigniter,coordinates,kml,geojson
I am currently grabbing the KML used to define the polygons seen here. I am using the algorithm detailed in this answer to determine if the point is inside the polygon. The problem I have though is if the point is inside an empty part of the polygon, as seen...

Trouble using fscanf to read coordinates in C

c,segmentation-fault,coordinates,fscanf
I know similar questions have been asked but none of them seemed to solve my problem. I get Segmentation fault (core dumped) when I run my code. The first line in "data.dat" has the total number of points in the file and the next lines have the point coordinates (in...

How do I calculate the distances between a varied location and fixed coordinates?

matlab,grid,coordinates,distance
I have four supply stations (S1, S2, S3 S4) and End Point (EU) with fixed coordinates on a grid as follows. % Grid Definition n = 10; % Number of grids in the x-direction x = 50; % Dimension of a grid in the x-direction k = 8; % Number...

How can I get users within a given radius of distance using PFGeoPoint

ios,objective-c,coordinates,pfuser,parse-framework
I have PFGeoPoint in Parse and there is a serachView where the user will enter the radius in miles. So it will return a list of users who are within dat radius of distance. I know we can fetch the distance from coordinates but I don't know how to get...

Java - Capturing screenshot with screen coordinates

java,image,coordinates,screenshot,area
I'm trying to capture area screenshots based on user entered coordinates. Basically user clicks on the screen gets x,y coordinates then clicks elsewhere for another pair of x,y coordinates which are then are put into a rectangle and create a screen capture using the robot library. Problem i'm having is...

Unable to capture coordinates inside a div element

javascript,jquery,coordinates
I need to capture coordinates on a click. But when I click inside cont, I get incorrect values. What could be the reason for this? It seems, that x-coordinate captured is correct, but Y coordinate is incorrect. HTML : <div id='first'> <p> First</p> <div id='second'> <p>Second</p> <div id='cont'> <span id='player'>...

How to find a corner in a list of coordinates?

python,coordinates
I have a style/performance issue for the following code: dq=((410, -890), (490, -890), (490, -790), (590, -790), (590, -710), (490, -710), (490, -590), (590, -590), (590, -510), (490, -510), (490, -410), (410, -410), (410, -510), (310, -510), (310, -590), (410, -590), (410, -710), (310, -710), (310, -790), (410, -790)) maxy=max([q[1]...

Determining a admissible heuristic (coordinate graph)

graph,coordinates,heuristics
I am trying to understand how to determine what the true cost of a coordinate graph is (h*(n)) so as to determine an admissible heuristic. In a normal coordinate graph would the true cost be from one coordinate to the other be the Manhattan distance (Assuming movement is limited to...

Create Google Maps links based on coordinates

google-maps,hyperlink,coordinates,share
I just can't seem to find an easy way of creating Google Maps links based on coordinates. Their new basic share urls contain a lot of parameters, for example - https://www.google.com/maps/place/Vetlanda,+Sweden/@57.4217311,15.0849255,13z/data=!3m1!4b1!4m2!3m1!1s0x465758d912d321b5:0x55675191e550be84?hl=en Any ideas? Not looking to embed but just to create external links that can be shared....

Find coordinates of tap event when using iScroll

cordova,coordinates,iscroll
I was using iscroll-zoom.js in a Phonegap app to display a large image, and I wanted to detect the x,y coordinates of any point the user touched. I was having trouble testing on Android as the event object had pageX and pageY = zero, regardless of where I tapped. After...

R maps - Filter coordinates out when plotting points in map

r,maps,coordinates
I have a large data frame of events locations (longitude, latitude). See a sample below: events <- structure(list(lat = c(45.464944, 40.559207, 45.956775, 44.782831, 45.810287, 35.913357, 43.423855, 45.2359, 45.526025, 41.91371, 46.340833, 40.696482, 42.367164, 41.913701, 41.89167, 46.046206, 41.108316, 45.514132, 45.688118, 37.090387, 43.446555, 41.913712, 46.614833, 45.368825, 41.892168), lon = c(9.163453, 8.321587, 12.983347, 10.886471,...

How do you convert from AltAz coordinates to equatorial coordinates in Astropy

python,coordinates,astropy
I have been trying to figure out how to convert a set of AltAz coordinates into equatorial coordinates, and so far all I have been able to find is how to convert equatorial into AltAz (but not the reverse) using the following method: c = SkyCoord('22h50m0.19315s', '+24d36m05.6984s', frame='icrs') loc =...

Calculate intersecting coordinates from vector

c#,vector,coordinates,cudafy.net
Given a vector (or two points) how can i get the discrete coordinates that this vector intersects in some given interval? I am using this such that given a ray(vector) i can calculate the pixels in an image that this ray intersects and use these as indexes for my image....

Calculating real world co-ordinates using stereo images in Python and OpenCV

python,opencv,computer-vision,coordinates,stereo-3d
I'm working on calculating the real world coordinates of an object in a scene by using a pair of stereo images. The images are simulations of perfect pinhole cameras so there is no distortion to correct and there is no rotation. I know OpenCV has a bunch of functions to...

Windows Forms Chart: Get mouse cursor coordinates in Chart axis scale?

winforms,charts,onclick,position,coordinates
I have a problem with the following sample: When I click at the place marked as '1' on my screenshot, I can get position in pixels by MouseClick event in a pretty easy way: private: System::Void chart1_MouseClick(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e) { Point chartLocationOnForm = chart1->FindForm()->PointToClient(chart1->Parent->PointToScreen(chart1->Location)); cursorPosX = e->X - chartLocationOnForm.X;...

Find an angle representing the direction of travel from origin coordinates

java,canvas,javafx,coordinates,coordinate-systems
I'm working on an animation where a number of triangular objects move across the screen. In order to ensure each faces the direction in which it is travelling, I need to rotate the image by the appropriate angle. My problem is that the angle my code returns does not accurately...

Convert Grid square numbers to coordanates

javascript,arrays,grid,coordinates,converter
How in JavaScript, would I convert a grid square number on, say a 4x4 grid, and easily convert it to grid coordinates? (Example: grid square #6 -> 2, 2) ^ = selected square [][][][] [][^][][] [][][][] [][][][] So basically, how do I (quickly?) convert a grid number to two coordinates....

What is the drawback of storing latitude/longitude as integer in mysql?

mysql,optimization,coordinates
I have a large MySQL table containing +250.000.000 rows, where I store different kind of points and coordinates. The table has the following columns: NodeId      Lat      Lon Till now, the Lat and Lon field were FLOAT(10,7) types, but I am experimenting in changing them to INT, because querying this table can be...

How to make and access global variables in Objective-C

objective-c,global-variables,coordinates
I have dropped a pin on a map through a search bar and I retrieve its coordinates, saving them in myLatitude and myLongitude doubles. This is done in the following snippets of code: class1.h @interface Location : UIViewController <UISearchBarDelegate, MKMapViewDelegate> @property (nonatomic, readwrite) double myLatitude; @property (nonatomic, readwrite) double myLongitude;...

Drawing a Line - Maximum Point

java,2d,line,coordinates
I drew a line that is at an angle based on a slider. I am trying to make the line's end Y coordinate a certain number (let's say 300), even if it is at an angle. Any ideas on how to do this? Here is the work on my line...

Get the current coordinates of an item on a Canvas widget given its item handle?

python,canvas,tkinter,coordinates,items
From reading the docs (http://effbot.org/tkinterbook/canvas.htm#reference), there doesn't appear to me to be a way to do this. Just wanted to make sure I hadn't made a mistake. (I.e. one would have to internally store the coordinates of various items in a program if one wanted to do boundary checking, for...

Loop structure for adding up coordinates in an array

javascript,arrays,loops,geolocation,coordinates
I have an array with coordinates in and want to add them up to determine a total distance (not just from point A to point B). My array is structured as latitude1, longitude1, latitude2, longitude2 and so on. I have to code to actually work out the distance (shown below),...

FInd the object from x,y in iOS

ios,uiviewcontroller,coordinates
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 .

How to get mouse position in the same place with different resolutions

java,coordinates,screen-resolution,java-2d,mouselistener
I developed a Monopoly Clone game (Bolivian monopoly) for the university. I put the monopoly board into Jpanel and try to get the mouse position in the exactly coordinate using e.getX() into the mouse listener event. the problem is that my game supports a loot of resolution 800x600, 1024x768, 1680x1050...

Change matrix/raster coordinates on R

r,matrix,coordinates,raster
I'm a beginner and I have worked a lot on my problem, but I am still stuck... I have a matrix containing values of world temperature. The size is 360*720. The values are from -180, -90 (Longitude, latitude) to 180, 90 with a resolution of 0.5. > head(matrix) NaN. NaN..1...

Matplotlib: Find a region on a graph by mouse click

python,matplotlib,coordinates,mouse,intervals
Suppose I have a program that plots sine and cosine functions. I want to be able to select a subinterval or region that is created by the graphs, such as π/4 < x < 5π/4 or -3π/4 < x < π/4. So if I have this: import numpy as np...

Update custom annotation pin image to standard annotation pin in swift

ios,swift,annotations,mapkit,coordinates
I want to update map view every 60 seconds & make an annotation with custom pin/image but want to show standard pin [red color - See Figure 6-1] icon to the previously drawn annotation. I tried like below code but that does not working properly. With another custom image it...

Trying to move y coordinate

c#,unity3d,coordinates
I am new to Unity. The code is in 2d and c#. I am trying to make it that when the player goes below they appear above and when the player goes above they appear below. Here is the error I get: Assets/Scripts/Player.cs(23,43): error CS1612: Cannot modify a value type...

How to split list of (X,Y) coordinates of path into seperate list of X and Y coordinates?

python,python-2.7,split,coordinates,instance
In the following function, 'graph' is a 2d grid list consisting of ones, zeroes and a 'two' (of obstacles, open areas and target respectively), 'start' is the point to start the search from. def bfs(graph, start): fringe = [[start]] # Special case: start == goal if start.val == 'g': return...

Only show results within range chosen by user

php,html,mysql,database,coordinates
I have a database table which stores long and lat coordinates. The user types in their postcode and should select a range for example 5 miles, then all the coordinates stored in the database which are within 5 miles should displayed. I have managed to convert the postcode the user...