coordinate-systems

Convert a UIView origin point to its Window coordinate system

╄→гoц情女王★ 提交于 2019-11-27 12:47:32
问题 I want to get the origin of scrollView in the window coordinate system. For Example, presently, scollView origin is (0,51). But in window coordinate system it should be 51 + 44(navigation bar height)+20(status bar height) = 115. Means in window coordinate system the scrollView.frame.origin should be (0,115). I tried with convertPoint: methods but getting (0,51) or (0,0) sometimes. Please provide a solution to this. Thanks 回答1: It sounds like your not converting between the proper views. A

WPF: how to make the (0,0) in center inside a Canvas

∥☆過路亽.° 提交于 2019-11-27 10:57:53
问题 The WPF Canvas has a coordinate system starting at (0,0) at the top-left of the control. For example, setting the following will make my control appear on the top-left: <Control Canvas.Left="0" Canvas.Top="0"> How can I change it to the standard cartesian coordinates? Basically: (0,0) at center flip Y I noticed this post is similar, but it does not talk about translating the coordinate system. I tried adding a TranslateTransform, but I can't make it work. 回答1: The best thing is to write a

Convert PictureBox Selection Rectangle according to SizeMode

自闭症网瘾萝莉.ら 提交于 2019-11-27 08:25:23
问题 I have two PictureBoxes pbOriginal and pbFace. After Selecting a "face" from an image in pbOriginal I clone the rectangle selection and place it into pbFace. However, Because pbOriginal is using SelectionMode=Stretch the actual area being copied is not the same as the area being selected. How do I convert the coordinates of the Rectangle so that they truly reflect the coordinates of the Stretched Image? 回答1: Here is an example that draws the second rectangle right along as you draw the first

Convert Lat/Longs to X/Y Co-ordinates

旧街凉风 提交于 2019-11-27 08:06:18
I have the Lat/Long value of an small area in Melbourne; -37.803134,145.132377 and also a flat image of that,that I exported from openstreet map( Osmarender Image ). Image width : 1018 and Height:916 I would like to be able to convert, using C++, the Lat/Long to an X,Y coordinate where the point would reflect the location. I used various formula's that I found in web like one given below but nothing helps. var y = ((-1 * lat) + 90) * (MAP_HEIGHT / 180); var x = (lon + 180) * (MAP_WIDTH / 360); It would be of great help if any one give me clear explanation of how to do this . Any code would be

Acceleration from device's coordinate system into absolute coordinate system

本小妞迷上赌 提交于 2019-11-27 06:12:54
From my Android device I can read an array of linear acceleration values (in the device's coordinate system) and an array of absolute orientation values (in Earth's coordinate system). What I need is to obtain the linear acceleration values in the latter coord. system. How can I convert them? EDIT after Ali's reply in comment: All right, so if I understand correctly, when I measure the linear acceleration, the position of the phone completely does not matter, because the readings are given in Earth's coordinate system. right? But I just did a test where I put the phone in different positions

Why clipping should be done in CCS, not NDCS

前提是你 提交于 2019-11-27 05:53:58
问题 Why clipping should be done in CCS, not NDCS. I think it is easier to clip in NDCS, but many book said the clipping should be done in CCS. They give an example that a line is laid over eye from behind and front. I could not understand why it can be a problem. 回答1: The only difference between Normalized Device Coordinates (NDCS) and Clip Space (CCS) is, that CCS is before the perspective divide and NDCS is afterwards. The reason why clipping doesn't work well in NDCS is that the perspective

Three.js: Show world coordinate axes in corner of scene

无人久伴 提交于 2019-11-27 04:28:08
问题 This is probably a very basic problem, but I haven't found a solution yet and it's been bugging me. I'd like to show arrows indicating the world coordinate directions (x, y, z) in the bottom right hand corner of the camera like is done in Maya, so that when rotating the camera around an object, or moving through a scene, you can still identify the directions of the world coordinates. I've tried to accomplish this using two different approaches and neither has worked so far. I have an object

How to draw lines in Java

两盒软妹~` 提交于 2019-11-27 03:46:32
I'm wondering if there's a funciton in Java that can draw a line from the coordinates (x1, x2) to (y1, y2)? What I want is to do something like this: drawLine(x1, x2, x3, x4); And I want to be able to do it at any time in the code, making several lines appear at once. I have tried to do this: public void paint(Graphics g){ g.drawLine(0, 0, 100, 100); } But this gives me no control of when the function is used and I can't figure out how to call it several times. Hope you understand what I mean! P.S. I want to create a coordinate system with many coordinates. jassuncao A very simple example of a

Convert GPS coordinates to coordinate plane

不羁岁月 提交于 2019-11-27 02:00:21
问题 This is somewhat related to another question I asked: Translate GPS coordinates to location on PDF Map. That got me to this point, now I'm stuck on the math. Let's say I have a floor plan of a building, I've taken gps coordinate readings from each corner of the building. Also assume that the floor plan is lined up with the latitude and longitude. How do I convert a GPS coordinate to a X,Y position on this map? I can't seem to get the math right. 回答1: Let delta_long and delta_lat be the

Finding Cities within 'X' Kilometers (or Miles)

被刻印的时光 ゝ 提交于 2019-11-27 00:31:36
问题 This may or may not be clear, leave me a comment if I am off base, or you need more information. Perhaps there is a solution out there already for what I want in PHP. I am looking for a function that will add or subtract a distance from a longitude OR latitude value. Reason: I have a database with all Latitudes and Longitudes in it and want to form a query to extract all cities within X kilometers (or miles). My query would look something like this... Select * From Cities Where (Longitude >