coordinates

Determine position of one image in another with PHP

心不动则不痛 提交于 2019-12-19 03:58:54
问题 I have two images(small and big). One of them contains another one. Something like one image is a photo and another one is a picture of the page of the photoalbum where this photo is situated. I hope you understood what I said. So how do I get coordinates (x,y) of a small image on the big one using PHP? 回答1: It is quite easy to do on your own, without relying on external libs other than gd . What you need to be aware of, is that you most likely cannot do a simple pixel per pixel check, as

How to generate coordinates in between two known points

女生的网名这么多〃 提交于 2019-12-19 02:27:56
问题 Background: I'm working with transport routes and Google provides Route points far apart enough to create 'shapes'. These are the bus/train routes you see in Google Maps. My Requirement: Google's points are far enough to create straight lines. However I want a point every, say, 5 metres. Problem: So, say I have two points [lat,long]: [-33.8824219918503,151.206686052582] and [-33.8815434600467,151.206556440037] Given those two points I can calculate the distance between them. Say it's 1km for

Find all integer coordinates in a given radius

╄→尐↘猪︶ㄣ 提交于 2019-12-18 16:49:37
问题 Given a two-dimensional coordinate system how can I find all points with integer coordinates in a radius from a given point? I want the points as x-coordinate and y-coordinate value. Finding points in a square around the given point is easy and could be done like that: for(int x = -radius + point.x; x < radius + point.x; ++x) for(int y = -radius + point.y; y < radius + point.y; ++y) { points.insert(point(x, y)); } But how can I find the points in a circle around the given point? This

Converting long/lat to pixel x/y, given a zoom-level

北城余情 提交于 2019-12-18 16:10:15
问题 I'm trying to develop a page in ASP.NET that will act as a tile-server for a Google Map It will pull a collection of latitude/longitude points from the database, then render them as small red dots on a transparent background, given a zoom-level (default: 15). It will then return the result as a GIF-type image. Have any algorithms or libraries been developed that allow me to take this set of latitudes/longitudes and convert them to a set of 2D pixel co-ordinates, given a zoom level? (This is

How do I get the global coordinates of a grouped svg element?

天涯浪子 提交于 2019-12-18 16:09:06
问题 Suppose I have the following document (fiddle): <svg> <g transform="translate(50,50)"> <rect width="20" height="20" style="fill:black;"> </g> </svg> How do I get the global coordinates of the rect element assuming I don't know that it's in a group? 回答1: It was actually kind of hard to find. Searching for methods of SVGElement results in pages saying SVGElement has no methods! It does in fact have a ton of methods, but they are inherited: http://www.w3.org/TR/SVG/types.html

MotionEvent GetY() and getX() return incorrect values

一笑奈何 提交于 2019-12-18 14:50:10
问题 I have following situation: I have a custom ListView with ImageView and TextView in a row. The ImageView has an onTouchListener, wchich invokes my onTouch method. Here are some lines from it: if (event.getAction()==MotionEvent.ACTION_MOVE) { layout.leftMargin = (int) event.getX() - dragIcon.getWidth()/2; layout.topMargin = (int) event.getY() - dragIcon.getHeight()/2; //Log.d("Tag", "Pozycja: " + event.getX() +", "+ event.getY()); } dragIcon.setLayoutParams(layout); When move is detected I'm

MotionEvent GetY() and getX() return incorrect values

蹲街弑〆低调 提交于 2019-12-18 14:49:12
问题 I have following situation: I have a custom ListView with ImageView and TextView in a row. The ImageView has an onTouchListener, wchich invokes my onTouch method. Here are some lines from it: if (event.getAction()==MotionEvent.ACTION_MOVE) { layout.leftMargin = (int) event.getX() - dragIcon.getWidth()/2; layout.topMargin = (int) event.getY() - dragIcon.getHeight()/2; //Log.d("Tag", "Pozycja: " + event.getX() +", "+ event.getY()); } dragIcon.setLayoutParams(layout); When move is detected I'm

The X angle between two 3D vectors?

北慕城南 提交于 2019-12-18 13:36:09
问题 I have two 3D vectors called A and B that both only have a 3D position. I know how to find the angle along the unit circle ranging from 0-360 degrees with the atan2 function by doing: EDIT: (my atan2 function made no sense, now it should find the "y-angle" between 2 vectors): toDegrees(atan2(A.x-B.x,A.z-B.z))+180 But that gives me the Y angle between the 2 vectors. I need to find the X angle between them. It has to do with using the x, y and z position values. Not the x and z only, because

Display location Using Longitude/Latitude Coordinates - Google Maps

守給你的承諾、 提交于 2019-12-18 13:07:23
问题 How can I input a set of coordinates and have Google maps show a location. This is all to be done through javascript (ie: no user interface) Any help is appreciated 回答1: Note: If you already have a latitude/longitude, see Alteveer’s answer. You'll need to need to use a geolocation service to get the latitude/longitude. Google Maps has one built in: http://code.google.com/apis/maps/documentation/javascript/services.html#Geocoding Here's an example of how to use it: <!-- Placeholder for the

Convert decimal coordinate into degrees, minutes, seconds, direction

随声附和 提交于 2019-12-18 11:31:41
问题 I have the following so far, but can't figure out a tidy way to get the direction letters in without a bunch of messy if statements. Any ideas? Ideally I'd like to extend the CLLocation class with a category to do this. -(NSString *)nicePosition{ double latitude = [self.latitude doubleValue]; double longitude = [self.longitude doubleValue]; int latSeconds = (int)round(latitude * 3600); int latDegrees = latSeconds / 3600; latSeconds = abs(latSeconds % 3600); int latMinutes = latSeconds / 60;