coordinate-systems

MKCoordinateRegion distance between center and borders

徘徊边缘 提交于 2020-01-01 12:31:22
问题 (Revised Question based on comment:) OK I will try to ask in other way...How can I get border coordinates of this circle overlay: (Original Question:) I am having weird problem with my iPhone app. I have MKCoordinateRegion which has center coordinate latitude: 51.509980 and longitude: -0.133700. I have used method MKCoordinateRegionMakeWithDistance and set the distance to be 16,093.44 meters (10 miles). I want to get border point of this region therefore I have this code: MKCoordinateRegion

How can I convert coordinates on a square to coordinates on a circle?

混江龙づ霸主 提交于 2019-12-30 02:10:47
问题 I'm developing an indie video game, and have been operating under the assumption that because the thumbstick on my controller has a circular range of motion, it returns "circular" coordinates; that is, Cartesian coordinates constrained to a circular area (of radius 1). In fact, the coordinates are "square"; e.g., the top-right thumbstick position registers as x=1,y=1. When I convert the coordinates from Cartesian to polar, the magnitude can exceed 1 - which has the effect that the player can

flip svg coordinate system

扶醉桌前 提交于 2019-12-28 11:45:13
问题 Is there a way to flip the SVG coordinate system so that [0,0] is in the lower left instead of the upper left? 回答1: I have done a lot of experimentation, and the only logical method is as follows: <g transform="translate(0,400)"> <g transform="scale(1,-1)"> Where 400 is the height of the image. What this does it move everything down so that the top of the image is now and the bottom of the image, then the scale operation flips the Y coordinates, so that the bit that is now off the page/image

How do android screen coordinates work?

让人想犯罪 __ 提交于 2019-12-27 11:35:21
问题 I am working with Android Animation and I have found the Android coordinate system to be quite confusing so I am here to ask this question about how coordinates work in Android. I am following this image for moving one view to another but it seems it's not working: 回答1: This image presents both orientation(Landscape/Portrait) To get MaxX and MaxY, read on. For Android device screen coordinates, below concept will work. Display mdisp = getWindowManager().getDefaultDisplay(); Point mdispSize =

How do android screen coordinates work?

我是研究僧i 提交于 2019-12-27 11:35:07
问题 I am working with Android Animation and I have found the Android coordinate system to be quite confusing so I am here to ask this question about how coordinates work in Android. I am following this image for moving one view to another but it seems it's not working: 回答1: This image presents both orientation(Landscape/Portrait) To get MaxX and MaxY, read on. For Android device screen coordinates, below concept will work. Display mdisp = getWindowManager().getDefaultDisplay(); Point mdispSize =

How can I specify vertices in pixels in OpenGL?

ⅰ亾dé卋堺 提交于 2019-12-25 03:08:10
问题 I want to write a small project with OpenGL C++ and I want to use pixel instead of float value, for example like that: glVertext2f(420, 300); Instead of: glVertex2f(0.4, -0.34); Is it possible? 回答1: If you want to use pixel coordinates your rendering, it's pretty easy to do so using an orthographic matrix, which you can create using glOrtho. Assuming your window is 800x600 you could use the following code: // Set your projection matrix glMatrixMode(GL_PROJECTION); glOrtho(0, 800, 0, 600, -1,

MFC with Opengl get 3d coordinate from 2d coordinate of mouse

不问归期 提交于 2019-12-25 02:34:56
问题 I am using this code from NEHE tutorial in my MFC based application on mouseclick void CRightOGL::OnLButtonDown(UINT nFlags, CPoint point) { // TODO: Add your message handler code here and/or call default GLint viewport[4]; GLdouble modelview[16]={0}; GLdouble projection[16]; GLfloat winX, winY, winZ; GLdouble posX, posY, posZ; GLfloat mv[16]; glGetFloatv( GL_MODELVIEW_MATRIX, mv ); glGetDoublev( GL_MODELVIEW_MATRIX, modelview ); glGetDoublev( GL_PROJECTION_MATRIX, projection ); glGetIntegerv

Base coordinate for poly2mask matlab

怎甘沉沦 提交于 2019-12-25 00:12:53
问题 I would like to ask that what's the origin pixel in the image coordinate system used in poly2mask function in MATLAB. It's been asked by others in OpenCV and wonder if it's the same in MATLAB. Let me repeat the person's question: In general there may be two kinds of such systems, for the first (0,0) is defined as the center of the upper left pixel, which means the upper left corner of the upper left pixel is (-0,5, -0.5) and the center of the image is ((cols - 1) / 2, (rows - 1) / 2). The

Coordinates transformation

ぐ巨炮叔叔 提交于 2019-12-24 20:33:08
问题 I have two 3D objects in space and i want to copy the points from one object to another. The problem is that these objects don't share a common coordinate system and i have to do coordinate transformations. I have the local transformation matrix for both objects and i have also access to the world transformation matrix. I know there's some calculations to be done using these transformation matrices but i don't know how. How can i transform one point in the first object so that it has the same

Get view direction relative to scene in vispy?

眉间皱痕 提交于 2019-12-24 16:31:20
问题 What is the cleanest way to get the view direction relative to your scene in vispy? view.scene.transform contains a whole chain of transforms: In [88]: view.scene.transform Out[88]: <ChainTransform [<STTransform scale=[ 960. -540. 1. 1.] translate=[ 960. 540. 0. 0.] at 0x139757309901840>, MatrixTransform(matrix=[[26.44507, 0.0, 0.0, 0.0], [0.0, 47.013458, 0.0, 0.0], [0.0, 0.0, -1e-06, 0.0], [-0.0, -0.0, -0.0, 1.0]] at 0x7f1bc8d526d0), <Inverse of '<ChainTransform [MatrixTransform(matrix=[[0