# I need open gl source code to make a point move along the circumference of the circle.

Posted by on

• Level 1:

An expert who has achieved level 1.

• Contributor

Hi
I'm studying Physics, not CS, but I've had a few brushes with OpenGL.
I'll use a Basic-like pseudocode syntax since I don't know what language you're using, and basic is very easy to read:

Const PI = 3.14159, Radius = 10

'Current angle, and angular velocity (dTheta / dt)
Dim Shared Theta as Single, Omega as Single

'Frame is called when you want to draw a new frame
Sub Frame(dt as Single)
'dt is number of seconds passed since last frame (typically less than one, since you want several frames per second)

'Initialize the frame (clear buffers, set up projection, etc)
InitFrame

'Increase angle
Theta = Theta + (Omega * dt)

'Calculate co-ordinates of point

glBegin(GL_POINTS)

'Set the colour of the point
glColor(<r>, <g>, <b>, <a>)

'Draw the point
glVertex2f(X, Y)

glEnd()

'Display the frame
RenderFrame

End Sub

Posted on Sep 05, 2009

• Battlesnake Sep 05, 2009

You would probably want to set up an orthographic projection for this, in InitFrame. I think the function for that is glOrtho - remember to select the right matrix before setting it up though!

×

Hi,
A 6ya expert can help you resolve that issue over the phone in a minute or two.
Best thing about this new service is that you are never placed on hold and get to talk to real repairmen in the US.
The service is completely free and covers almost anything you can think of (from cars to computers, handyman, and even drones).
Good luck!

Posted on Jan 02, 2017

×

my-video-file.mp4

×

## Related Questions:

### If the circumference of a circle is 15m what is the diameter?

You can go to https://www.omnicalculator.com/math/circumference and calculate.

Anyway:
The diameter is the length of the line through the center that touches two points on the edge of the circle.

Aug 27, 2017 | The Computers & Internet

### What is the diameter of a circle with a 120 ft. circumference?

Check out this page from Open High School. It explains the process:

http://openhighschoolcourses.org/mod/book/view.php?id=258&chapterid=502

Aug 14, 2014 | Home Fencing

### 15" circle what is outside measurement

If you would like to know the circumference of a 15" diameter circle this is the formula:
circumference = radius x 2 x pi
circumference = diameter x pi

in our case:
circumference = 15" x 3,14
circumference = 47 ,1" (that's 119,634 cm)

May 06, 2014 | Cars & Trucks

### Help finding the circumferance of a circle

The circumference of a circle is given by the expression
Circumference= 2* PI* Radius of circle
C=2*Pi*R
The area is given by
Area of a disk with radius R = Pi* R*R or PI*R^2
Area= PI*R^2

Mar 11, 2014 | SoftMath Algebrator - Algebra Homework...

### Trying to determine if a tangent is present when a triangle overlaps a circle

In which language? This is really more a mathematical problem than a programming/compilation one. Try walking the circumference of the circle, testing for a point along each of the triangle's segments. If only one such point can be found, or a series of consecutive points (since software "circles" are never true circles, they're made up of short straight segments), then you have a tangent.

You can save a lot of time and math by making coarse estimates first - for example, don't bother testing for tangentiality for any circumferential segment that's fully above, to the left or right of, or below, all three points of the triangle - you CANNOT have a tangent in those areas.

An alternate approach is... walk the triangle instead of walking the circle. Test for a single circle crossing point. Again, you can save time by checking each segment first, and walking only segments that actually cross the circle's circumference. If no part of the circle can be found mathematically between any pair of vertices, then discard that segment outright.

Mar 10, 2014 | Computers & Internet

### Circle equation

If you know the center, measure the distance between the center and one point on the circumference. Measure with the opening of a compass and report on a ruler, or use a ruler.
Take the measure of the radius and multiply by 2. Any other indirect way of getting the radius does not constitute a measure but a calculation.
The diameter of a circle enters in two formulas.
Length of Circumference: C=Pi*D (D diameter) ====>D=C/Pi
Area of the disk A=Pi *D^2/4 =====>D=SQRT(4*A/Pi), SQRT is the square root operation.

Dec 31, 2013 | Office Equipment & Supplies

### What is the radius of a 30'' pipe

30" diameter? Radius is 15" (half of diameter).

30" circumference (distance around) is a little more complicated...

The number is the ratio of the circumference of a circle to the diameter. The value of is approximately 3.14159265358979323846...The diameter of a circle is twice the radius. Given the diameter or radius of a circle, we can find the circumference. We can also find the diameter (and radius) of a circle given the circumference. The formulas for diameter and circumference of a circle are listed below. We round to 3.14 in order to simplify our calculations.

Nov 17, 2009 | Gateway FPD1975W 19" LCD Monitor

### Example of program in c++ and there code

Hello my friend, I am Jonas I work as a programmer in some various programming languages. Here try this code:
This program is design to output the Diameter, circumference, and area given a radius of a circle. #include <iostream.h> int main() { int radius, diameter, circumference, area, pi; cout << " Enter the radius of a circle\n"; cin >> radius; pi = 3.14159; diameter = 2 * radius; circumference = 2 * pi * radius; area = pi * (radius)^2; cout << "Diameter formula executing.....(2 x r)\n"; cout << "Diameter is " << diameter << endl; cout << "circumference formula executing.....(2 x pi x r)\n"; cout << "circumference is " << circumference << endl; cout << "area formula executing......(pi x [r x r])\n"; cout << "area is " << area << endl; return 0; }
Also if you need tutorial you can visit this site Learning C++ .Hope this solution will able to help your problem solved. If you need more assistance just reply to this post or send me a mail at geo_jonas@yahoo.comThank you and Godbless.

Jul 09, 2009 | Computers & Internet

### How you use a stanley center square #46-101

No need for a manual. Just hold it so that the two edges of the "vee" line up with the circumference of the circle and scribe a line along the steel rule. Then turn approx. 90 degrees and scribe another line along the rule that intersects the first. The point of intersection is exactly the center of the circle. This tools only function is to find the center of circles.

Mar 05, 2009 | Measuring Tools & Sensors

#### Related Topics:

434 people viewed this question

Level 3 Expert

Level 3 Expert