coordinates

How to get the world coordinates of a point in a child actor?

三世轮回 提交于 2019-12-10 07:01:03
问题 I have Group objects that consist of other Group objects, that finally consist of Actor objects. Now, when the groups and actors are rotated, offset and scaled, the coordinates in the "world", or in relation to the root node change. How do I get the world coordinates of a point in an actor's local space? To illustrate a bit more, here's an example of what I want: Group parentGroup; Actor childInGroup; ... parentGroup.addActor(childInGroup); childInGroup.setPosition(10f, 15f); childInGroup

Numpy matrix of coordinates

喜你入骨 提交于 2019-12-10 03:57:47
问题 I'm trying to get a matrix of coordinate-arrays. This is different from numpy.meshgrid. For example, for a 2x2 size I'd want the 2x2x2 output [[[0,0],[0,1]], [[1,0],[1,1]]] as a numpy array. This probably looks and reads cleaner a 2x2 matrix of tuples: [[(0,0),(0,1)], [(1,0),(1,1)]] (except I don't think you can have tuples in a numpy array, and it's not the point here) This simple example can be done by switching the axes of numpy-meshgrid's output (specifically, moving the first axis to be

Get X/Y Coordinates on Button using 'onclick' and JavaScript

百般思念 提交于 2019-12-10 03:36:47
问题 I am a JavaScript beginner and am looking for a way to get the x and y coordinates on a button when it's clicked. This works in Opera, IE9 and Chrome but I can't get it to work in Firefox. Here is my code so far: Function in JavaScript: function buttonClick(subEvent) { var mainEvent = subEvent ? subEvent : window.event; alert("This button click occurred at: X(" + mainEvent.screenX + ") and Y(" + mainEvent.screenY + ")"); } Here is the HTML section: <input type="button" onclick="buttonClick()"

Show current location of user on an offline static image (jpeg) - Android

独自空忆成欢 提交于 2019-12-10 00:12:57
问题 Background / Concept: I want to create an application that can help user searching for specific things. Let say nearby restaurants. Here I want to include an offline map covering 1 km area around that restaurant, (its easy i can take snap of google map). Problem: is it possible to indicate current user position on that static image file? I have some idea that I note the Lat / Long of all four corners of that image, take user current position, do some calculation and show the current spot..

How to get the X Y coordinates and pixel size of a TextView?

空扰寡人 提交于 2019-12-09 17:07:17
问题 Given a TextView , is it possible to know at runtime the X and Y coordinates of where it is drawn? Is it also possible to know the size (width/length) in pixels? 回答1: There are getLeft() , getTop() , getWidth() , getHeight() methods for a view, it works for textView too. for more information , see the following link... getLeft() and getTop() will return you the starting x,y co-ordinates. http://developer.android.com/reference/android/view/View.html 回答2: Coordinates relative to parent int x =

How to find correct neighbors for any giving coordinate?

青春壹個敷衍的年華 提交于 2019-12-09 16:57:51
问题 Update: this question is seeking guidance on how to get a set of neighbors for any given coordinate. I created a 2d array that contains coordinates, int[][] coordinates= { { -1, -1 }, { -1, 0 }, { -1, +1 }, { 0, -1 }, { 0, +1 }, { +1, -1 }, { +1, 0 }, { +1, -1 } }; As you can tell, these are the neighbors for coordinates (0,0). Now I am trying to implement a method that takes two parameters (int positionX, int positionY) , and use the input parameters value coordiante(x,y) as the starting

PoDoFo Extract text + coords from a pdf

柔情痞子 提交于 2019-12-09 13:56:19
问题 I have been trying for a while to use the PoDoFo C++ library to extract text and lines (with their respective coordinates). But I have no way to do this. This is what I have so far: #include <iostream> #include <stdio.h> #include <vector> #include <podofo/podofo.h> using namespace PoDoFo; using namespace std; int main( int argc, char* argv[] ) { const char* filename = "hello.pdf"; PdfVecObjects *x = new PdfVecObjects(); PdfParser parser(x, filename); parser.ParseFile("hello.pdf"); for

Android - create TextView (or EditText) programmatically and set it in a specific place on the screen giving coordinates

萝らか妹 提交于 2019-12-09 13:30:14
问题 I am building an android app where the user paints some objects in the screen. One type of object is a Text object. The user creates the object by dragging his finger and the object is shown as a rectangle that can be moved/reshaped. When user taps the text object, I launch a new activity where user enters text which I return on the onActivityResult method. Now I want to show the text in the object. I can have access to stuff as the coordinates of the Rectangle etc from my text class. What I

ActionScript - Inaccurate Mouse Coordinates?

╄→尐↘猪︶ㄣ 提交于 2019-12-09 12:58:16
问题 when tracing the mouseX / mouseY or localX / localY coordinates of a display object, why does x start at 1 while y starts at 0? for example, i've drawn a simple 400 x 400 pixel sprite onto the stage with a MouseEvent.MOUSE_MOVE event listener that calls a handler function to trace the local coordinates of the mouse. the first, top-left pixel returns {x:1, y:0} and the last, bottom-right pixel returns {x:400, y:399} . shouldn't both the x and y start and end with the same value? i'm not sure

Draw curved lines in ggmap, geom_curve not working

不羁岁月 提交于 2019-12-09 11:20:49
问题 I would like to make a map of the Netherlands with curved lines between cities. I have two dataframes number one called: df_verticles which contains 24 cities with their lat/lon combination. The second dataframe called: df i want to use to draw a curved line between lat/lon from combination to the lat/lon to combination. > head(df_vertices) city AmountSessions totalkWh AmountRFID scaledAmount scaledkWh Latitude Longitude 1 Alkmaar 13608 104554.68 1326 0.07139012 0.026941910 52.63903 4.755538