Draw mohr circle using C programming

In summary, the speaker needs help with completing their assignment, which involves writing a program to calculate principal stress using three methods, one of which is drawing a Mohr circle. They do not know how to draw graphics using C programming and it is urgent. They offer to post the equations needed for drawing. They are currently using open gl to draw the circle, but are having trouble changing the radius automatically according to the formula. They need help with this as the assignment is due tomorrow.
  • #1
jaymin
10
0
i'm facing problem in completing my assignment. actually i need to write a programme to calculate principal stress from 3 method..
one of them is drawing mohr circle...
but i don't even know how to draw a graphic using C programming..
can anyone help me?
it's really urgent...
thanks

(p/s:if need formula to draw, i can post t equations)
 
Technology news on Phys.org
  • #2
jaymin said:
i'm facing problem in completing my assignment. actually i need to write a programme to calculate principal stress from 3 method..
one of them is drawing mohr circle...
but i don't even know how to draw a graphic using C programming..
can anyone help me?
it's really urgent...
thanks

(p/s:if need formula to draw, i can post t equations)

There are lots of online tutorials for C. Knowing the equations, this should not take too long to figure out.
 
  • #3
You need a graphics library. Your instructor almost certainly had one in mind, but if not try http://www.libsdl.org/index.php" .
 
Last edited by a moderator:
  • #4
i'm now using open gl to draw the cirle...
however i can't change t radius automatically
according to formula..
i have to change the value manually in worksheet...
so how to change the radius automatically?
please help me..
i hav to submit the assignment tommorrow..
thanks
 

FAQ: Draw mohr circle using C programming

How do I draw a Mohr circle using C programming?

To draw a Mohr circle using C programming, you will need to first understand the mathematical equations and concepts behind the Mohr circle. Once you have a grasp of these concepts, you can use C programming to input the necessary values and equations to create the circle.

What are the required inputs for drawing a Mohr circle using C programming?

The required inputs for drawing a Mohr circle using C programming include the normal and shear stress values at two different points on a material, typically denoted as σx and τxy. Additionally, you will need to know the modulus of elasticity and shear modulus of the material in order to calculate the radius and center of the Mohr circle.

Can I use C programming to draw a Mohr circle for any material?

Yes, C programming can be used to draw a Mohr circle for any material as long as you have the necessary inputs and equations for that specific material. Keep in mind that different materials may have different equations and constants, so you may need to adjust your code accordingly.

Are there any libraries or resources available for drawing a Mohr circle using C programming?

Yes, there are several libraries and resources available for drawing a Mohr circle using C programming. Some popular options include the GNU Scientific Library (GSL), the Boost C++ Libraries, and the NIST Digital Library of Mathematical Functions. These resources provide pre-written functions and equations that can be used to draw a Mohr circle.

Can I plot multiple Mohr circles using C programming?

Yes, you can plot multiple Mohr circles using C programming by repeating the necessary equations and inputs for each circle. However, it is important to keep in mind that each circle will have its own set of inputs and equations based on the material being analyzed. It may be helpful to create a loop or function to streamline the process of plotting multiple Mohr circles.

Similar threads

Back
Top