Delphi : How to plot a simple 2d graph? [closed] - delphi

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I'm using Delphi for my computer science coursework and need my program to plot a simple graph for projectile motion. I've struggled in finding a way to implement this and was wondering if anyone has had experience in drawing graphs or would be able to point me in the right direction.
The main idea that I have tried is plotting all the x values and drawing a line to the corresponding y value at that given time, but each time it comes out really weird and doesn't work.

Steps for simple graph:
1. Provide data values in array/list
2. Find minimal and maximal values for X and Y components
3. Calculate linear formulas for mapping data values to screen coordinates (min x = > left of rectangle for drawing and so on)
4. Draw line segments applying formulas to get coordinates
5. If needed, draw axes
P.S. Is TChart using prohibited?

I agree that TChart that ships with Delphi is enough to do that task. Anyway you can check this page also.

Related

Is it possible to gather the image matrix of a pygame gameboard without rendering the image to the screen? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I wrote a 2d simulation (very similar to the Atari- OpenAi games) in pygame, which I need for an reinforcement learning project. I'd like to train a neural network using mainly image data, i.e. screenshots of the pygame gameboard.
I am able to make those screenshots, but:
- Is possible to gather this image data - or, more precisely, the
corresponding rgb image matrix - also without rendering the whole
playing ground to the screen?
As I figured out there is the possibility to do such in pyglet ... But I would like to avoid to rewrite the whole simulation.
Basically, yes. You don't have to actually draw anything to the screen surface.
Once you have a Surface, you can use methods like get_at, the PixelArray module or the surfarray module to access the RGB(A)-values of each pixel.

what is the equation of ellipse with two points of its large diameter? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 7 years ago.
Improve this question
I want to get the equation of an ellipse by having two ends of its large diameter. These two points can form the ellipse in any place on the plain with any orientation. I think it is possible to have its small diameter if we have the equation of its large diameter. For example, we say the length of small diameter is half of length of large diameter.
I know the standard equation for ellipse that is centered on point (0,0) is x^2/a^2 + y^2/b^2 = 1. But this is the simplest version. My ellipse can be centered at any point with any orientation.
Is it possible to have the equation with this information?
What can the equation be?
Knowing two endpoints of a major axis is not enough to make an ellipse equation.
Because an ellipse with one fixed axis can have any eccentricity between 0 and 1.
You can find a brief explanation at https://math.stackexchange.com/questions/239787/can-an-ellipse-with-fixed-semi-axis-have-different-values-of-eccentricity
So when you get enough information about your ellipse, you can build analytical equation according to formulas here https://en.wikipedia.org/wiki/Ellipse#General_ellipse

Swift: How can i get height of an object with the camera? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
Hi i would like measure an object in 'cm' (or similar) of an object obtained with the camera
Any idea?
Thanks!!
You can't get a precise measurement.
You would need to input roughly how far away the object is from the camera in inches.
You need to measure how many pixels tall the item is that you want to measure.
Using the pixels measured, combined with the DPI of the camera and the distance the camera is from that object and some estimated angles then you can work out an approximate height of the object in inches using trigonometry.

How to position an object in 3D space using cameras [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
Is it possible to use a couple of webcams (or any camera for that matter) to get the x, y and z co-ordinates of an object and then track them perhaps using OpenCV as it moves around a room.
I'm thinking of it in relation to localising and then controling an RC helicopter.
Yes. You need to detect points on both images simultaneously and then match the pairs that correspond to the same point in the scene. This way you will have the same point represented by different coordinate spaces (camera 1 and camera 2).
You can start here.
If using depth sensor is acceptable then you can take a look at how ReconstructMe does it. Otherwise take a look at this google search.

Finding repeating patterns/images in images [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 10 months ago.
The community reviewed whether to reopen this question 10 months ago and left it closed:
Original close reason(s) were not resolved
Improve this question
I've been looking around for some papers (or info) on this topic.
To avoid a misunderstanding: I'm not talking about finding a supplied pattern in multiple locations.
Repeating patterns can also be understood to mean repeating images. The definition of pattern here isn't abstract. Imagine, for instance, a brick wall. The wall is composed of individual bricks. A picture of the wall is composed of the repeating image of a brick.
The solution must preferably find the largest repeating pattern. Large in this context can be defined two ways: pixel area or number of repetitions.
In the above example, you can cut the bricks in half. In order to make a brick, you can rotate a segment and attach the halves. While the complete brick is the largest repeating image in terms of pixel area, there are 2x more repetitions of half blocks.
Any thoughts?
A number of methods come to mind:
Fourier Transformation of the image
Wavelet Analysis
Autocorrelation
I'd start with fourier analysis: Any shape repeating in a regular pattern in the image creates a very distinct spatial frequency spectrum: One major frequency and some harmonics.
I'm not sure if this is what you're looking for, but I suggest searching for "Texture based segmentation". Take a look at this bibliography, for example: http://www.visionbib.com/bibliography/segment366.html

Resources