java,eclipse,position,coordinates,rectangles

Essentially here's what you need to do: Based on your points 1 and 3, construct the other two points 2 and 4 to complete the rectangle definition. Take in the user-input point, we'll call it 5. Calculate the area made by triangles for all P(1,2,5), P(1,4,5), P(2,3,5), P(3,4,5) and add...

A pretty messy approach would be to find all indexes of matching x-coordinates and for each index found check whether the y-coordinate for the given index is equal to the y in question. So given coordinates x, y and array lists visitedX and visitedY you could do something like this:...

Here's the code which gave me the coordinates of where I touched the image, regardless of where it was scrolled to, or zoomed: document.addEventListener('tap', tap_on_floor_plan, false); setTimeout(function () { myScroll = new IScroll('#wrapper', { zoom: true, scrollX: true, scrollY: true, tap: true, mouseWheel: true, wheelAction: 'zoom' }); }, 100); function...

java,libgdx,touch,coordinates,viewport

Keep a Vector2 handy so you don't have to create new ones each time: private Vector2 tmpVec2 = new Vector2(); Then use viewport's unproject method: public boolean touchDown(int screenX, int screenY, int pointer, int button) { stage.getViewport().unproject(tmpVec2.set(screenX, screenY)); xTouch = tmpVec2.x; yTouch = tmpVec2.y; } ...

c++,function,structure,coordinates,circle

I would name the struct something like Point rather than Points, since a single instance of the struct holds only one pair of x,y coordinates. Then a suitable distance function might be something like float distance(const Point& point1, const Point& point2) { return sqrt((point1.x * point2.x) + (point1.y * point2.y));...

algorithm,coordinates,coordinate-systems,coordinate

So here's my question: does this algorithm exists already? Has it a name? This mapping is called the Z-order curve or Morton code: In mathematical analysis and computer science, Z-order, Morton order, or Morton code is a function which maps multidimensional data to one dimension while preserving locality of...

java,line,coordinates,shape,rectangles

you can use getX1(); getX2(); and getY1() getY2() for getting x1,y1 and x2,y2 coordinates .there is no width and height for a 2d line.read api here update assume u have a line 2d shape Shape s = new Line2D.Float(1, 2, 200, 200); now you if want to get (x1,y1,x2,y2)then use...

javascript,d3.js,graph,coordinates

According to the d3 documentation, aligning your nodes along a diagonal line, will make the force directed algorithm balance the nodes positions with the least number of iterations in most cases. I use it this way and I get consistent positions every time I use the same data set. The...

google-maps,hyperlink,coordinates,share

Why not http://www.google.com/maps/place/lat,lng I think this is the simplest way http://www.google.com/maps/place/49.46800006494457,17.11514008755796...

regex,string,notepad++,coordinates

Thanks. But I have also managed to consult it with IT student on my dorms and he figured it out. find: "([+-]*[0-9]+.[0-9]+),([+-]*[0-9]+.[0-9]+),([+-]*[0-9]+.[0-9]+)," replace: "x=$1 y=$2 z=$3" The magic for me is the dollar sign plus number denoting the found expression in given () brackets. I hope it will help someone...

ios,objective-c,coordinates,pfuser,parse-framework

EDITED Parse actually have a simple solution to that: int radiusInKilometers = 400; //Example PFGeoPoint * myGeoPoint = [PFUser currentUser][@"geoPoint"]; // Your geoPoint PFQuery *query = [PFUser query]; [query whereKey:@"geoPoint" nearGeoPoint:myGeoPoint withinKilometers:radiusInKilometers]; [query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) { if (!error) { NSLog(@"Successfully retrieved %d scores.", objects.count); // Do something with...

ios,objective-c,parsing,coordinates

Assuming the text file's in your bundle, you can store the text in an NSString like so: NSString* path = [[NSBundle mainBundle] pathForResource:@"coordinates" ofType:@"txt"]; NSString* content = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:NULL]; Then separate the text into lines using componentsSeparatedByString:, go through each line with a loop, then separate each line...

python,canvas,tkinter,coordinates,items

Use the coords method: coords = the_canvas.coords(item_id) ...

php,codeigniter,coordinates,kml,geojson

The point is inside the green boundaries, but you just want to override that with another polygon. Assuming that you have multiple polygons, it might be worth keeping track of whether the polygons are shaded (True) or not shaded (False), or some other combination based on what your algorithm actually...

c#,math,coordinates,converter,coordinate

//Parsing the DDM format is left as an excersize to the reader, // as is converting this code snippet into a usable function. double inputDegrees = 52; double inputMinutes = 37.9418; double latitude = inputDegrees + (inputMinutes/60); // 52.632363 ...

You have to take two more things into account. First, the Grid may align (i.e. move) the whole stretched Polygon according to its HorizontalAlignment and VerticalAlignment properties. If you don't want to calculate that by yourself, you could get an appropriate GeneralTransform object by myPolygon.TransformToAncestor(grid): var polygonGeometryTransform = myPolygon.RenderedGeometry.Transform; var...

do you mean you want this? var frm: CGRect = imageView.frame frm.origin.x = frm.origin.x - 50 frm.origin.y = frm.origin.y - 50 frm.size.width = frm.size.width + 500 frm.size.height = frm.size.height + 500 imageView.frame = frm ...

javascript,rotation,three.js,coordinates

That won't work because the matrix for your target is not in the same place, and can be scaled differently and all sorts of stuff. A better technique is to raycast from your eye object, and see if it hits the target object. http://threejs.org/examples/#webgl_geometry_terrain_raycast var raycaster = new THREE.Raycaster(); raycaster.setFromCamera(...

javascript,html,google-maps,google-maps-api-3,coordinates

create a polyline (See the documentation for options availble) var polyline = new google.maps.Polyline({ // set desired options for color, opacity, width, etc. strokeColor:"#0000FF", // blue (RRGGBB, R=red, G=green, B=blue) strokeOpacity: 0.4 // opacity of line }); // create the polyline (global) var path = []; // global variable...

the given touches argument is a set of detected touches. You only see one touch because you select one of the touches with : touches.anyObject() // Selects a random object (touch) from the set In order to get all touches iterate the given set for obj in touches.allObjects { let...

Rect temp = Rect(0,0); This line should be Rect temp = new Rect(0,0); Actually this shouldn't even compile. Just use Rect temp = new Rect(); ...

Assuming you are in a grid world where the only allowed movements are N,S,W,E (or adiacent cells in general) yes. The Manhattan distance would be the true cost (and even the best heuristic!) SLD would of course be smaller but also less informative than MHD that represents h*. In case...

Convert whatever the location object is returning for variables x and y to a Float if you want to print the coordinates using NSLog with the %f formatter. NSLog("position x %f and y %f", Float(location.x), Float(location.y)) If you aren't dead set on using NSLog, you can also do what Okapi...

Using the raster package is the right intuition but when you instantiate it with just the matrix it doesn't get the extents accurately. This will do it: library(raster) r <- raster(nrow=360,ncol=720,vals=matrix) plot(r) raster will initialize a raster object with (by default), world boundaries. You can optionally specify the coordinate reference...

Best thing is to vectorize operations instead of using loop. You can do: transform(x, utm_x=gx*cos(-0.031989084) - gy*sin(-0.031989084) + 625774 , utm_y=gx*sin(-0.031989084) + gy*cos(-0.031989084) + 1011776) # tag gx gy utm_x utm_y #1 2 994.1 488.3 626783.2 1012232 #2 4 990.5 488.9 626779.6 1012233 #3 6 993.5 498.3 626782.9 1012242 #4...

python,opencv,computer-vision,coordinates,stereo-3d

1) Case of no rotation, only translation parallel to the horizontal axis of the image plane, cameras with equal focal lengths. Denote with "f" the common focal length. Denote with "b" the baseline of the stereo pair, namely the distance between the cameras' optical centers. Given a 3D point P,...

There's probably a simpler way, but basically, you can calculate two points on a circle based on the angle and the inverse of the angle (angle - 360) With a circle with a radius of 150, this will give you a line of 300, for example The red line is...

mysql,optimization,coordinates

You are not likely to achieve a search performance improvement from either partitioning the table or changing the datatype of your lat/lon from FLOAT to INTEGER. Why not? The amount of data stored is the same for FLOAT and INTEGER: 32 bits. FLOAT gives plenty of precision for GPS-resolution data....

java,algorithm,coordinates,quadtree

The data structure you need is called an R-Tree. Most RTrees permit a "Within" or "Intersection" query, which will return any geographic area containing or overlapping a given region, see, e.g. wikipedia. There is no reason that you cannot build your own R-Tree, its just a variant on a balanced...

Your code works for me, as long as I insert plt.show() after mpl_connect in getCoord: def getCoord(self): fig = plt.figure() ax = fig.add_subplot(111) plt.imshow(self.img) cid = fig.canvas.mpl_connect('button_press_event', self.__onclick__) plt.show() return self.point ...

java,string,url,format,coordinates

In your getCoordsLists() method you are joining the collectors with ", " thats why, after building the url it is adding spaces after every coordinate. so just replace the ", " with "," in the following line: String list = "( " + alternative.coords.stream().map(item -> String.format("%.4f , %.4f", item.x, item.y))...

android,json,plot,coordinates,android-graphview

try something like this GraphView.GraphViewData[] recordGraphData=new GraphView.GraphViewData[records.size()]; for(int i=0; i<records.size();i++) { recordGraphData[i]=new GraphView.GraphViewData(i,records.get(i).get(1)); } graphView.addSeries(new GraphViewSeries(recordsGraphData)); ...

According to the ggvis documentation it's only possible to modify the data of a plot with interactive controls (e.g. props) and not the underlying plot specification (e.g. scales). It's possible to use Shiny to achieve what you're trying to do though, for example: library(shiny) library(ggvis) data.example=data.frame( "V1"=c(rep("A",times=10),rep("B",times=10)), "V2"=c(runif(10,1,10000),runif(10,100,1000)) ) shinyApp(...

java,coordinates,screen-resolution,java-2d,mouselistener

the best way would be to not work with pixel coordinates but with percent coordinates. on the screenshot, your board has a top offset and a left offset, as well as a width and a height. for the current mouse x position, subtract the left offset and divide by the...

Figured out the answer myself, inspired by '@mu is too short'. Basiclly, this is the code: jumpto -500,50 [co_x,co_y]=getxy() write co_x write co_y I assume that Coffeescript figures out the co-ords are two pieces of data, and splits it between the two variables, as opposed to cramming them both into...

ios,swift,annotations,mapkit,coordinates

I have solved my problem by creating custom annotation class like below - import UIKit import MapKit var ARROW_ANNOTATION : NSString = "ARROW_ANNOTATION" var PIN_ANNOTATION : NSString = "PIN_ANNOTATION" class Annotation: NSObject, MKAnnotation { var currentLocation: CLLocationCoordinate2D var _title : String var subTitle : String var direction : CLLocationDirection! var...

javascript,c#,unity3d,sprite,coordinates

This is called billboarding (language is c#) : public class LookAtCamera : MonoBehaviour { public Camera cameraToLookAt; void Update() { transform.LookAt(cameraToLookAt.transform); } } this will orientate any game object to face the camera. Other way to do what you want is to create a prefab/s for the sprites with the...

php,sorting,coordinates,spiral

Algorithm design First, free your mind and don't think of a spiral! :-) Then, let's formulate the algorithms constraints (let's use the salesman's perspective): I am currently in a city and am looking where to go next. I'll have to find a city: where I have not been before that...

wxpython,tooltip,coordinates,paint

You should try BalloonTip http://wxpython.org/Phoenix/docs/html/lib.agw.balloontip.html It creates a new Frame for the tooltip and sets it according to coordinates of the object....

Are you sure? They look the same (only posting as an "answer" since it's too long for a comment): library(sp) 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")...

c#,sorting,floating-point,coordinates,grahams-scan

This is what i wrote and it worked for all the cases finally. Let me admit it can be improved for performance and this might be a quick and dirty way but this what i am using at the moment. P.S: I also admit that "Convex Hull" or "Graham Scan"...

javascript,html5,google-maps,canvas,coordinates

What you need is reverse processing. You can simply iterate canvas and create index and related RGBA values by following formula and compare with filled color. var index = (x + y * imageData.width) * 4; sample execution is as follow: var imageData = ctx.getImageData(0, 0,canvas.width, canvas.height); var data =...

javascript,authentication,comparison,coordinates,gesture-recognition

Reading about handwriting recognition software it seems that the early phases such a recognising the strokes might be helpful. Decompose the gesture into a number of elements (lines or curves) then apply some matching algorithms.

This is what you could to to decrease your headache with so many variables: Create a structure to group all 3 coordinates of a point create and array for your points Like this: struct Point3 { double x, y, z; }; // <-- the semocolon (;) is mandatory here //...

Managed to solve the problem. As mentioned, the data was not uniform and because of that, surfwas jumping from one end of the plot to the other, creating a total mess. Solved it by organising the values linearly using linspaceand then using those values to create the meshgrid and then...

python,list,tuples,coordinates

For your data cooList = [(11.6702634, 72.313323), (31.67342698, 78.465323)] coordinate = (11.6702698, 78.113323) the shortest Pythonic answer is: nearest = min(cooList, key=lambda x: distance(x, coordinate)) with a function distance(a, b) returning the distance between the points a and b as a float, which you have to define yourself. Now you...

winforms,charts,onclick,position,coordinates

Yep, there is a civilized way of doing that if I understand your question correctly. You can use the Axis.PixelPositionToValue method to do just that. E.g. (in C#) chart.ChartAreas[0].AxisX.PixelPositionToValue(pt.X) chart.ChartAreas[0].AxisY.PixelPositionToValue(pt.Y) ...

java,canvas,javafx,coordinates,coordinate-systems

// calc the deltas as next minus current double delta_x = next.xPos - current.xPos; double delta_y = next.yPos - current.yPos; // Calc the angle IN RADIANS using the atan2 double theta = Math.atan2(delta_y, delta_x); // this.angle is now in degrees // or leave off *180/Math.PI if you want radians this.angle...

3d,2d,webgl,coordinates,computational-geometry

If i understand your problem correctly, what you need to do is: Convert your points into 3D points: A(2,2,0), B(4,2,0), C(4,6,0), D(2,0,0) Get "duplicate" points with a height: E(2,2,1), F(4,2,1), G(4,6,1), H(2,0,1) Create triangles from those points: (there might be mistakes in this example) Front side: E EF AB B...

animation,swift,height,width,coordinates

Check out here the answer: http://stackoverflow.com/a/28029425/1135714 This answer solved my issue....

javascript,html,google-maps,google-maps-api-3,coordinates

Use lastCoordinates as an object, store for each coordinate a property in the object with a name based on the coordinate, e.g. x+'_'+y; Before you create a marker check if lastCoordinates already contains a property with the particular name: var lastCoordinates={}; function gotdata(){ if (xmlhttp.readyState == 4){ var d =...

java,swing,coordinates,screenshot,jtextpane

When you call getX() and getY() on any Swing component, you get the x and y relative to the component's container, not the screen. Instead you want the location of the component relative to the screen and get position based on that via getLocationOnScreen() Point p = txtCodigo.getLocationOnScreen(); int x...

objective-c,global-variables,coordinates

The easiest way to do this would probably be by using a singleton. You can create a new singleton class that is then accessed from anywhere in your app. So you might create CoordinateManager or something and then use this to handle location coordinates you want to be global. E.g....

ios,objective-c,opengl-es,coordinates,glkit

You can't read the z buffer on OpenGL ES. When I've needed to do this kind of 3D hit testing I've projected a 3d line through the scene and done the hit-testing myself. For OpenGL on Retina devices you need to multiply x and y by the scale. To support...

c,segmentation-fault,coordinates,fscanf

@Weather Vane well answered the major issue. Below are additional points. #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { // Check argc if (argc < 1) Print_Error_And Quit(); int n = atoi(argv[1]); FILE *fp; fp = fopen("data.dat","r"); if (fp == NULL) { perror("Error"); } int number; char str[3];...

SQLite has no square root function, but for comparing distances, we can just as well use the square of the distance: SELECT * FROM MyTable ORDER BY min((x1-x0)*(x1-x0) + (y1-y0)*(y1-y0), (x2-x0)*(x2-x0) + (y2-y0)*(y2-y0)) LIMIT 1 ...

math,javafx,geometry,coordinates

You can use the Math.atan2(dy, dx) to get the angle theta from the conversion of rectangular coordinates (x, y) to polar coordinates (r, theta). Later use it to convert it to degrees. import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.layout.StackPane; import javafx.scene.shape.Line; import javafx.stage.Stage; public class Main extends Application {...

javascript,arrays,grid,coordinates,converter

Just calculate the division and the module of that number by the array length: 6 / 4 = 1 (6 % 4)-1 = 1 Remember that arrays start at 0, so the 6th position is (1, 1) [][][][] [][^][][] [][][][] [][][][] ...

php,html,mysql,database,coordinates

If you have an mySQL database, look to these questions, they deal with the same problem. Mysql within distance query http://gis.stackexchange.com/questions/31628/find-points-within-a-distance-using-mysql You need to create a SQL statement where all your coordinates within a certain distance are the results. It may look like: SELECT *, ( 3959 * acos( cos(...

3d,three.js,coordinates,leap-motion

Finally fixed it thanks to Peter's last example. It was Test 3 that helped me find out the issue. The problem actually was that I seem to have been using a different 'scene' (variable aptly named) than the scene that the rigged hand was using. I didn't realize they were...

assign polygon map to an object: m = getMap(resolution="low") convert events into an sp object -- first longitude, then latitude: pts = SpatialPoints(events[c(2,1)]) assign CRS: proj4string(pts) = proj4string(m) plot points inside any of the polygons: points(pts[m,], pch = 3) select points inside Italy: it = m[m$ISO_A2 == "IT",] points(pts[it,], col...

python,matplotlib,coordinates,mouse,intervals

There are some built in tools to provide blocking mouse input (see plt.ginput). The other option is to roll your own. The easiest way to do this is to make a helper class to store the clicked values: class ClickKeeper(object): def __init__(self): self.last_point = None def on_click(self, event): self.last_point =...

I found how to do it. If you know how to convert UTM (Equations for UTM conversion to WGS84(lat,long) are here http://en.wikipedia.org/wiki/Universal_Transverse_Mercator_coordinate_system#Locating_a_position_using_UTM_coordinates) to WGS84 latitude, longitude, you can convert MTM. MTM is like UTM but more precise, the zones are 3° large insted of 6° for UTM, the scaleTM is...

r,csv,coordinates,interpolation

Well, based on your summaries the range of x is 0.02 and the range of y is 0.01. However, in your expand.grid call you ask for sequences from the min to the max with a step size of 3.5. So your seq calls will return 1 value each, and your...

c#,unity3d,coordinates,unity3d-2dtools

C# is case-sensitive, meaning that update and Update are not the same. Unity looks for a method called Update to call each frame, and your update method doesn't match. Just capitalize that U and you should be good to go!...

Another option is to pass a key function to max: >>> max(enumerate(dq), key=lambda x: (x[1][1], -x[1][0])) (11, (410, -410)) >>> idx, maxval = max(enumerate(dq), key=lambda x: (x[1][1], -x[1][0])) >>> idx 11 Here, where we're working with numbers, we can use the sign-flip trick to exchange min and max....

android,imageview,coordinates,translate-animation

Here's a complete example based on what user3249477 and Vikram said: final TextView positionTextView = (TextView)findViewById(R.id.positionTextView); ImageView myimage = (ImageView)findViewById(R.id.imageView); ObjectAnimator translateXAnimation= ObjectAnimator.ofFloat(myimage, "translationX", 0f, 100f); ObjectAnimator translateYAnimation= ObjectAnimator.ofFloat(myimage, "translationY", 0f, 100f); translateXAnimation.setRepeatCount(ValueAnimator.INFINITE); translateYAnimation.setRepeatCount(ValueAnimator.INFINITE); AnimatorSet...

math,geometry,coordinates,trigonometry

If the given angle is φ, try: cx = ((ax-bx)*COS(2φ)+(by-ay)*SIN(2φ)-ax-bx)/2 cy = ((ay-by)*COS(2φ)+(ax-bx)*SIN(2φ)-ay-by)/2 Why? I calculated the coordinates of the mirror of B about the black line and defined C as the midpoint between B and its mirror. The rest is trig. Example: [ax,ay] = [7,1] [bx,by] = [6,4] φ...

ios,animation,swift,coordinates

use UIViewAnimationOptions.Repeat and UIViewAnimationOptions.Autoreverse together to do that. You just have to set one frame change inside the animation block. You cannot have more than one state change to the same property inside an animation block. UIView.animateWithDuration(1.0, delay: 0.6, options: UIViewAnimationOptions.Repeat | UIViewAnimationOptions.Autoreverse | UIViewAnimationOptions.AllowUserInteraction, animations: { println("Animation function animateStuff()...

java,android,imageview,zoom,coordinates

I managed to solve my issue by using the Mike Ortiz TouchImageView the code I used to map the coordinates to the original bitmap is this: private PointF mapBeginCoordinates(PointF beginCoordinate, PointF endCoordinate) { //TODO we only have one aspect ratio for the current picture, so we should remove redundancy float...

you can get mouse Coordinates with very simple math. Are you going to attach event handler to image tag? If that is the case, you can copy below code. I understand you would be very frustrated if you don't have understanding of javascript events, DOM model, etc. It is not...

android,for-loop,arraylist,coordinates,variable-assignment

If I've understood you correctly, your for loop needs to look something like for (int i = 0; i<mPoints.size(); i++) { float xi = mPoints.get(i).x; float yi = mPoints.get(i).y; System.out.println("Point " + i + " y: " + yi); System.out.println("Point " + i + " x: " + xi); }...

If I am interpreting your question correctly, you wish to isolate out points in your matrix that match a particular z coordinate. Failing an exact match, you wish to find the closest z coordinate to your desired query. Also, since your data is stored in a 3 x 1088 matrix,...

java,math,geometry,coordinates,helix

Helix is circular shape with progressive Y value. // Start point private double x; private double y; private double z; private double degree; private double rY; @Override public void run() { // We use the same formula that is used to find a point of a circumference double rX =...

arrays,mongodb,mongoose,coordinates,geospatial

You need to do an $unwind operator on the Location array first in your aggregation pipeline, then $group the resulting documents to apply the accumulator expressions $first and $last. Your aggregation pipeline should look like this (untested): db.foo.aggregate([ { "$unwind": "$location" }, { "$group": { "_id": "$_id", "longitude": { "$first":...

c#,table,itextsharp,coordinates,absolute

You have several errors in your code. When you add a table at absolute positions, it is forbidden to use BeginText() and EndText() as that would cause nested text objects. As explained in ISO-32000-1, you can not next BT/ET sequences and that's exactly what will happen if your table contains...

javascript,arrays,loops,geolocation,coordinates

There are several ways, I would do it like this: int sum(int[] array) { int sum = 0; for(int i = 0; i < array.size(); i++) { sum += distance(array[i], array[i+1], array[i+2], array[i+3]); i +=4; } return sum; } ...

matlab,grid,coordinates,distance

Please check the following code. Since as per your information both A and DC positions are not fixed, I assumed A as fixed for the moment. Let me know if it does not suite your requirement. clear all; s1 = [100 20]; s2 = [20 150]; s3 = [50 450];...

jquery,coordinates,phaser-framework,phaser

First, if you want to position your button according to the game size, you should probably use game.width/game.height which are more reliable. Now if you want to adapt your button's position according to the screen size, there's no magic solution. Here's a generic article about the topic for instance. You...

I don't know much about astronomy, but it seems like there's plenty of documentation: transforming between coordinates full API docs for coordinates For me, cAltAz.icrs works and returns the original c. I needed to tweak a bunch of stuff to make it work on newAltAzcoordiantes (need to define x, stop...

qt,drawing,coordinates,qml,qt-quick

You can not use negative values for this purpose since negative width or height is not supported in QML. But you can use Scale type to accomplish this : Rectangle { id: rectangle1 x: 257 y: 221 width: 50 height: 50 color: "#000000" transform: Scale { origin.x: 0; origin.y: 0;...

python,python-2.7,split,coordinates,instance

You can transpose and map the tuples to lists or use map and itemgetter. from operator import itemgetter l = [(4, 4), (4, 5), (4, 6), (4, 7), (4, 8), (3, 8), (2, 8), (1, 8), (1, 9)] a,b = map(itemgetter(0),l), map(itemgetter(1),l) print(a,b) a,b = map(list,zip(*l)) print(a,b) [4, 4, 4,...

javascript,svg,d3.js,coordinates,topojson

The solution is pretty easy. The size of the picture was just not correctly set. Also the userSpaceOnUse needs to be deleted and if needed you can set the creation position with x and y: svgimage.append("pattern") .attr("id","p1") .attr("width","10") .attr("height","10") .append("image") .attr("xlink:href", "pics/point.jpg" ) .attr("width", 5) .attr("height", 5) .attr("x", 1) .attr("y",...

android,layout,imageview,coordinates

You can create a ImageView programmatically with ImageView iv = new ImageView(context); Then you have to set the LayoutParameters for the view. If you plan to add the view to a RelativeLayout you must use RelayiveLayout.LayoutParams. So you can have to do the same as you know from xml: add...

There's document.elementFromPoint method, but it only returns the topmost element. To get all the elements under a point you could find the topmost one, hide it and look at the point again until no more elements are there: var elementsAt = function( x, y ){ var elements = [], current...

You're using incorrect syntax: Change HAVING to WHERE and use a subquery so you can refer to the alias of the calculation rather than having to repeat the formula: select * from ( select *, ( 3959 * acos( cos( radians($locationLatitude) ) * cos( radians( endingLatitude ) ) * cos(...

java,coordinates,mouselistener,mouseclick-event,jmapviewer

As you have observed, getPosition() "Calculates the latitude/longitude coordinate of the center of the currently displayed map area." You probably want Coordinate getPosition(java.awt.Point mapPoint) which "Converts the relative pixel coordinate … into a latitude / longitude coordinate." You can call it in your implementation of JMapController, as shown here for...

java,image,coordinates,screenshot,area

My bet is that you are using the constructor for Rectangle which accepts point coordinates and dimensions, and you are passing in two points coordinates.

javascript,html,arrays,geolocation,coordinates

If you want to use an array, don't use new Array(), use the array literal [] instead, and then we can just assign the whole thing in one go: var mapArray = [ position.coords.latitude, position.coords.longitude ]; But, since you already have that convenient position object, why not just rely on...

android,xml,xml-parsing,coordinates,android-xmlpullparser

There are two problems with your code. First, this won't work : if (tagname.equalsIgnoreCase("coordinates")) { frame.setCoordinates(Integer.parseInt(text)); } You must have either the same name as the xml tag or use tagname.contains("coordinates"). Second, x and y will always be equal to 0 because you are erasing the previous value with a...

double lat = -86.0490143029144; double lon = -45.197069205344; string latDir = (lat >= 0 ? "N" : "S"); lat = Math.Abs(lat); double latMinPart = ((lat - Math.Truncate(lat) / 1) * 60); double latSecPart = ((latMinPart - Math.Truncate(latMinPart) / 1) * 60); string lonDir = (lon >= 0 ? "E"...

java,awt,coordinates,polygon,java-2d

I toyed around with the A* algorithm this week. There may be other solutions to your request, but since I already have the code, it was just a matter of adapting it to your needs. However, for your specific requirement you could also simply use a primitive flood-fill algorithm and...

You can't directly use transform.position.y to set a value for it. Instead Unity is asking that you use some temporary value or simply write as following - if (transform.position.y > 5.5f) { transform.position = new Vector3(transform.position.x, -10.0f, transform.position.z); } if (transform.position.y < -10.5f) { transform.position = new Vector3(transform.position.x, 5.0f, transform.position.z);...