coordinates

finding location of specific characters in UILabel on iPhone

北城以北 提交于 2019-12-17 19:46:52
问题 I have a UILabel with some text, say "Hello World abcdefg" The label can have multiple lines, different font sizes etc. Question : How do I find the coordinates of all letters "d" in this UILabel. Logical first step is find the position of those characters in the string (UILabel.text), but then how do I translate that into coordinates when it's actually drawn on screen The idea is to find those coordinates and draw something custom on top of that character (basically to cover it with a custom

Android Google Maps: How to get the area which is currently shown in screen device?

≯℡__Kan透↙ 提交于 2019-12-17 18:19:59
问题 Is there a way to get the coordinates of the current area, which is shown at the device? Background is, we want to show "nearby" places, which are stored in our own database. So let's say, the user looks at following clip of a map: How do we get the longitude/latitude of the screen (or the point in the middle of the screen and a radius which covers everything?). Please keep in mind, center of the map is not usually the current position, since the user can move the center of the card! 回答1: Use

svg: generate 'outline path'

半腔热情 提交于 2019-12-17 16:14:03
问题 I have a set of coordinates that I turn into an svg path (using cubic beziers to make it smooth). When I apply a certain stroke width, I get the following result (the blue dots are my coordinates) What I am interested in is to get a path that runs around the gray shape (like: pick any point on the gray/white border, and round around the shape until you're back at the starting point). How would I go about computing such a path? for reference, this is my svg info: <g> <title>number 3</title>

How do I check if a longitude/latitude point is within a range of coordinates?

最后都变了- 提交于 2019-12-17 11:31:51
问题 I have a number of longitude and latitude coordinates that make up a polygonal zone. I also have a longitude and latitude coordinate to define the position of a vehicle. How do I check that the vehicle is located within the polygonal zone? 回答1: This is essentially the Point in polygon problem on a sphere. You can modify the ray casting algorithm so that it uses arcs of great circles instead of line segments. for each pair of adjacent coordinates that make up your polygon, draw a great circle

How do I check if a longitude/latitude point is within a range of coordinates?

独自空忆成欢 提交于 2019-12-17 11:31:48
问题 I have a number of longitude and latitude coordinates that make up a polygonal zone. I also have a longitude and latitude coordinate to define the position of a vehicle. How do I check that the vehicle is located within the polygonal zone? 回答1: This is essentially the Point in polygon problem on a sphere. You can modify the ray casting algorithm so that it uses arcs of great circles instead of line segments. for each pair of adjacent coordinates that make up your polygon, draw a great circle

How do I check if a longitude/latitude point is within a range of coordinates?

↘锁芯ラ 提交于 2019-12-17 11:31:19
问题 I have a number of longitude and latitude coordinates that make up a polygonal zone. I also have a longitude and latitude coordinate to define the position of a vehicle. How do I check that the vehicle is located within the polygonal zone? 回答1: This is essentially the Point in polygon problem on a sphere. You can modify the ray casting algorithm so that it uses arcs of great circles instead of line segments. for each pair of adjacent coordinates that make up your polygon, draw a great circle

Get coordinates on tapping map in android

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-17 09:41:52
问题 I'm trying to make something like this: I have a mapactivity and when the user taps the map it shows the coordinates of that location. I already overrided the onclick method but it isn't even called. Any Idea? public class MapPoint extends MapActivity implements OnClickListener { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.mappoints); MapView map = (MapView)findViewById(R.id.mapview); map.setOnClickListener(this); map

Get coordinates on tapping map in android

被刻印的时光 ゝ 提交于 2019-12-17 09:41:05
问题 I'm trying to make something like this: I have a mapactivity and when the user taps the map it shows the coordinates of that location. I already overrided the onclick method but it isn't even called. Any Idea? public class MapPoint extends MapActivity implements OnClickListener { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.mappoints); MapView map = (MapView)findViewById(R.id.mapview); map.setOnClickListener(this); map

3D coordinates on a sphere to Latitude and Longitude

隐身守侯 提交于 2019-12-17 08:10:04
问题 I've got the following information: There exists a sphere with origin (0,0,0) and radius R. After doing a ray-sphere intersection I know a point (XYZ) in 3D space that is on the sphere (the exact position in 3D space where the line pierces the sphere hull). For my program I'd like to calculate the Latitude and Longitude of the XYZ point on the sphere, but I can't think (or Google) up a way to do this easily. So in short, the function that I'm trying to write is this: public static LatLon

How do you find a point at a given perpendicular distance from a line?

半世苍凉 提交于 2019-12-17 07:09:11
问题 I have a line that I draw in a window and I let the user drag it around. So, my line is defined by two points: (x1,y1) and (x2,y2). But now I would like to draw "caps" at the end of my line, that is, short perpendicular lines at each of my end points. The caps should be N pixels in length. Thus, to draw my "cap" line at end point (x1,y1), I need to find two points that form a perpendicular line and where each of its points are N/2 pixels away from the point (x1,y1). So how do you calculate a