Hi all. Would it be a good idea to have a polar coordinate class and derive from it spherical and cylindrical coordinate classes? Or should I keep 3 separate classes?

Member Avatar
Member Avatar
+0 forum 2

I'm trying to show a user JOptionPane where they enter x and y coordinates each in their own textfield, but I don't know how to store user input as ints. So I need to do something like: int xCorFromUser = xCor; int yCorFromUser = yCor; I have this code so far: JTextField xCor = new JTextField(); JTextField yCor = new JTextField(); Object[] fields = {"Enter X Coordinate:", xCor, "Enter Y Coordinate:", yCor}; JOptionPane.showConfirmDialog(null, fields, "Move Shape", JOptionPane.WARNING_MESSAGE);

Member Avatar
Member Avatar
+0 forum 7

I'm wondering how impossible it can be to connect a touch panel (with USB controller) to a PC for it to send X,Y coordinates when an event happens (the panel is touched). After searching the web for an entire day I couldn't find more then pieces of information that don't tell the whole story. Most of what I understood so for is that I can buy some touch panel development kit ([ebay](http://www.ebay.com/itm/5-6-4-Wire-Resistive-Touch-Screen-Panel-Digitizer-126-5x100mm-USB-controller-/271523635500?pt=LH_DefaultDomain_0&hash=item3f3811e12c)), create some basic C code that acts like a driver and then use those C functions to handle input on the device in other applications. Question is, is …

Member Avatar
Member Avatar
+0 forum 3

To refresh my mind I did some exercises about complex numbers. I was constantly drawing axes and arrows. So I decided to print out some worksheets with a program to make my life a bit easier, and because it is always fun to design a little program to do that for me. Like to share this. Enjoy. This how it can look on the screen. ![Polarsheet.png](/attachments/large/1/9d876fc2d39ccc5c0d6fcf366a09a2a2.png "align-center") The listing just shows the main two classes. In the possiblity that anyone would be interested in the whole project, I might send a zip file. But it should be obvious how to …

Member Avatar
+2 forum 0

Hello, sorry for the rudeness for asking for help on the first post but I'm still a beginner in programming. I am trying to create a GUI for plotting function using Tkinter and Python. In the top a label will show the current position of the mouse in the canvas and the position of the last click in the canvas. I am learning classes at uni so I need to learn how to use it. Whenever the label changes, instead of it staying in the top, a new window opens up with the details. [CODE]from Tkinter import * def Click(event): …

Member Avatar
Member Avatar
+0 forum 5

I want to use below code for my google map, which is posted on internet and easy to understand, but it doesn't works. I hae get API key but when I replace the original key, I don't know which part of code I need to modified. how to get a latlag cooridinates cooresponding with my API key. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title>Google Maps JavaScript API Example</title> <script src="http://maps.google.com/maps?file=api&v=2&key=abcdefg" type="text/javascript"></script> <script type="text/javascript"> //<![CDATA[ function load() { if (GBrowserIsCompatible()) { var map = new GMap2(document.getElementById("map")); map.setCenter(new GLatLng(37.4419, -122.1419), 13); } } …

Member Avatar
Member Avatar
+0 forum 6

Is it possible to find where a user **clicked** on the site, not just where it is his mouse ? -(doesn't matter in what website programming language) Thanks alot!!

Member Avatar
Member Avatar
+0 forum 1

Hi, all. I would like to know about convertion from (x, y) to (latitude, longitude)? For Example: In my project(windows form - VB.NET) i have a Panel (control) and have a MouseMove Event then when i moving the mouse it have a location such as: Label1.text = e.X Label2.text = e.Y So how to convert it to?: Label1.text = Latitude(e.X) Label2.text = Longitude(e.Y) Your answer would be greatly appreciated. *Thanks,* **Bazzer Respeto**

Member Avatar
Member Avatar
+0 forum 2

This question could probably be posted in several areas, but what I am writing is a google maps application and I'm also pulling feeds, so I'm choosing this as the main category to post this question in. Basically, I've pulled a feed from NOAA which gives me weather alerts. I would like to plot these areas on google maps, however, the geolocation coordinates they supply are 6 digit numbers which took me a few hours to find out what it is. It's a FIPS code - the first digit is the county subdivision, the first three digits are the state, …

Member Avatar
Member Avatar
+0 forum 2

So, basically im using the codea bove to generate coordinates for a grid, but I only want to generate coordinates for the "outer ring" of a square. SO imagine a grid of 7x7, I won't generate coordinates for the inner 5x5 square, only for the outer ring. Basically I drew it all out on paper, used fake numbers and based off that I came up with t his logic that can be changed around. In the code "25" is used as dummy data for the distance between the center of one square and another. The 150 that you see can …

Member Avatar
+0 forum 0

Hello. What are some ways that one can work with (x,y) coordinate pairs in Python? I'm doing a homework assignment that requires me to create a program that can check for certain binary relations (reflexive, transitive, symmetric), and I'm having an issue coming up with the best approach for it. I'm trying to use lists, but coming up with the best logic to work with them is the big issue here. Here's the code I have so far: x = [] y = [] def get_relation(): choice = "YES" while (choice.upper() != "NO"): x-coord = int(input("Enter the x-coordinate: ")) y-coord …

Member Avatar
Member Avatar
+0 forum 2

Greetings, I'm making a program that draws a certain mathematics function. Here's the problem,my x and y axis aren't defined as the picturebox's. What I mean is that my axis are not located in the top left corner of the picturebox. So normally, the function would start from the top left corner.. How do I offset the "(0,0)" coordinates of the picturebox to where my x and y axis intersect? I tried some stuff I found on the internet, but they aren't an actual "offset" of the (0,0) coordinates because it was just making the function start at a certain …

Member Avatar
Member Avatar
+0 forum 2

How can I get the coordinates of the output of a truetype font. I need to write a function like so: [CODE]struct CartesianCoord{float x,float y}; CartesionCoord *printfont(const char *filename,char ch, int &len) { /*Read the font in filename.ttf and convert it to a set of vertices describing the resulting shape. Do this for the letter 'ch' and return an array of coordinates describing it. len stores the length of this returned array.*/ }[/CODE] I think I need to know more about .ttf file formats but I do not know where to begin! (Yes I have tried googling it)

Member Avatar
Member Avatar
+0 forum 2

According to this post [url]http://www.python-forum.org/pythonforum/viewtopic.php?f=3&t=31349#p146797[/url] it claimed to be possible to create a list were you can store and recall data using a coordinate system ... [code]SomeList[1][5][2] = 234 [/code] I have been playing around with the code a while, and have ran into a problem. No matter what I do, when I am assigning data to a coordinate, it ignores the first 2 coordinates, and writes the data to every slot for the third coordinate. [code] ListX=[] ListY=[] ListZ=[] NewList3D=[] DementionX=10 DementionY=5 DementionZ=5 for xx in range(DementionX): ListX.append([0]) for yy in range(DementionY): ListY.append(ListX) for zz in range (DementionZ): ListZ.append(ListY) …

Member Avatar
Member Avatar
+0 forum 2

Hey I have recently started to learn canvas in html5. As of now I can draw all the basic shapes rectangles arcs etc. I am also able to get the mouse coordinates and show them in a text box in the main body of the html. I am just wondering how do I implement the coordinates I got using clientX and clientY into my canvas script so I can draw freely?.

Member Avatar
Member Avatar
+0 forum 1

This is code to plot a "random walk" in polar coordinates.See also: [url]http://www.daniweb.com/software-development/csharp/code/379275[/url] Just posted the code of my main form, more details can be found in the zip file. I also included a sample output. I perhaps intend to use this in some sort of game, were a biologist has to track down an animal with a sender device attached.

Member Avatar
Member Avatar
+0 forum 2

Hi guys, I have a difficult problem to solve. I have a list with 4 columns of values as follow 750.633 379.039 652.524 1112.63 930.491 452.16 842.753 1191.78 882.063 446.411 787.56 1183.43 434.362 410.174 325.863 1145.34 954.426 445.297 865.449 1183.74 1233.67 194.909 1155.27 908.305 1505.97 917.95 1441.07 1698.01 852.882 133.219 754.444 845.786 429.308 392.396 324.916 1127.72 358.381 310.049 241.12 1037.81 It can be from 10 to 700 raw entries and they are stored in a text file. For the time being I will just focus on the first 2 columns (i just need to keep the other 2 as they …

Member Avatar
Member Avatar
+0 forum 22

What polar coordinates are is explained [url=http://en.wikipedia.org/wiki/Polar_coordinate_system]here[/url]. I wanted to draw some polar functions myself, so I changed my [url=http://www.daniweb.com/software-development/csharp/code/217204]plotting class [/url] a bit and added a polar struct to a new project.. Just posted code for the Plot class and the polar point structure here. You can find an example of output as well, and the complete project in a zip file. This is just a basic thingy, so error correction is also basic. Enjoy! :)

Member Avatar
+2 forum 0

Hi All! I'm try to make a game in C++ with OpenGl. So far i've programmed the sprite and the platform. the next thing is to create a AI bot who will try to kill you in the game. but I've got the most bisarr problem with that: The AIBot class are making a holy random big fat square in the platform despite I never programmed it to do so. [CODE] /************************** * Includes * **************************/ #include <windows.h> #include <gl/gl.h> /************************** * Function Declarations * **************************/ LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); void EnableOpenGL (HWND …

Member Avatar
Member Avatar
+0 forum 2

Hi, I am building a simple android application that sends GPS coordinates from an Android phone to a Webserver, and the received co-ordinates are displayed one by one in the server. I think both my client and server side programs are correct, but I am not sure. Please correct the code if its not correct. Where/How can I see the received co-ordinates? Also I need to see it like this [CODE]Latitude Longitude 55.17 -3.48 52.18 -2.11 50.23 -1.45[/CODE] the 1st 55.17 and -3.48 are displayed when the server receives it and both 55.17,-3.48 and 52.18,-2.11 are displayed when the second …

Member Avatar
+0 forum 0

Hi, i want to get current position of cursor on the form. there are label to show the coordinates of cursor position. anyone can help me. i don't have idea for this. thanks Best regards.

Member Avatar
Member Avatar
+0 forum 2

[CODE]void CScreenCoordDlg::OnMouseMove(UINT nFlags, CPoint p) { GetCursorPos(&p); m_ValX = p.x; m_ValY = p.y; UpdateData(FALSE); }[/CODE] I used the following code to get the mouse coordinates on mouse move. But the problem is as soon as the mouse moves out of the dialog window it stops updating the mouse coordinates. Although it shows the mouse coordinates with respect to the top left of the screen ,i.e, (0,0), when inside the dialog window, I want the program to work globally, that is, when the mouse is outside the window it should update the coordinates. Where's the problem, what should be done to …

Member Avatar
+0 forum 0

Hi there, I have a set of coordinates (data points) that I want to use Python3 to fit an exponential decay curve to. I've used this resource [URL="http://mathworld.wolfram.com/LeastSquaresFittingExponential.html"]here[/URL] as a base for building my program. The problem is, no matter what the x-value I put in is, the y-value ALWAYS comes up as 1.0! My code is below. [CODE]# curve fitting algorithm # least squares fit method import math n = 800 p0 = (5*(10**6)) decay = (1.16*(10**-3)) def calculate_a_fit(): numerator = 0 numeratorPos = 0 numeratorNeg = 0 denominator = 0 denominatorPos = 0 denominatorNeg = 0 # calculate …

Member Avatar
Member Avatar
+0 forum 7

Is there any code that will enable me to click on portions of the form with the use of coordinates? I know most of you find it easier to just use controlname.click but it is not possible for my application. Hope someone can help. Thanks.

Member Avatar
Member Avatar
+0 forum 7

Hello, I'm working on a program that requires an XY coordinate plan and I can't seem to find a source anywhere!! that shows how to print a "." or "+" or anything at a certain xy coordinate on the screen. for instance, I need to be able to take 2 integers (or even real numbers preferably), put them into (x,y) form and then print on the window where they are. If this makes sense and you could explain the coding for it, it would greatly help me in completing this program! thank you!!

Member Avatar
Member Avatar
+0 forum 1

I'm having a bit of a problem with coordinates and mapping PictureBoxes. Here's the situation: I've got a PictureBox holding an image of a football pitch. The aim is to record the shot positions on this pitch. So whenever the mouse is clicked on the pitch, I am recording the X and Y coordinates of the mouse at that time. This means that when I read from the database, it plots the shots accordingly. The problem I am facing is when the form is moved from the top left corner of the screen. I have the form set at 1024x768px …

Member Avatar
Member Avatar
+0 forum 2

In short, I've created a program that when a user left clicks it will create a dot at that location (cursor position). After doing some debugging (reviewing coords printed) it doesn't appear to be a coord problem (not sure though), but a perspective problem (may be displaying improperly). The problem is when a user clicks, a dot isn't created where the mouse clicks but in another location. The farther you click away from the origin (client 0,0) the more noticeable the problem is (the farther away from the mouse the dot is created). I'll attach the program below. When you …

Member Avatar
Member Avatar
+0 forum 2

I am trying to write a program that will read values from spreadsheets and stuff and I know I need to use CSV files instead of Excel files and stuff, but say I want to just read a single entry at a specific coordinate how do I access that one instead of the entire thing? I'm really trying to avoid having to read the entire thing and use massive arrays and hold everything in the program and access it that way.

Member Avatar
Member Avatar
+0 forum 4

Hi, I know that there are a lot of webpages devoted in telling me how the OpenGL mouse function works, but I still don't understand. What I need to know, when my: [CODE] void processMouse( int button, int state, int x, int y){ ... } [/CODE] Returns x,y. What does x,y look like? as in: [INDENT]Are the values of X Y the pixel location on the screen (where the resolution is 800x600, for example, so XY could be (400,300)) Does X = 0 , and Y = 0 at the bottom left side of the screen? If the values of …

Member Avatar
Member Avatar
+0 forum 1

Hi there! this an excerpt from an extracted pdb file my team has done in the format of a text file. ATOM 1 N ASN A 2 [B]18.668 27.299 52.379[/B] 1.00 41.19 N ATOM 2 CA ASN A 2 [B]19.400 26.674 53.492[/B] 1.00 40.18 C ATOM 3 C ASN A 2 [B]19.710 27.737 54.550[/B] 1.00 37.56 C ATOM 4 O ASN A 2 [B]19.123 27.737 55.640[/B] 1.00 38.90 O ATOM 5 N LEU A 3 [B]20.637 28.606 54.184[/B] 1.00 34.40 N those in bold are the coordinates we need to extract and in the form of (x,y,z) down a long …

Member Avatar
Member Avatar
+0 forum 27

The End.