Clear Filters
Clear Filters

How to make a line in Mohrcircle

2 views (last 30 days)
jeongyeon kim
jeongyeon kim on 20 Dec 2023
Edited: lazymatlab on 20 Dec 2023
I make a Mohrcirlce matlab program and I want to draw line like this. Then how to change the matlab?
% MohrCircle_Area_ex1.m
% This matlab code for Mohr's Aera Circle about cross section
% of the beam.
clear clc clf
format compact
I_x = 3
I_y = 0
I_xy = 2
% R:Radius of a Circle ==================
R = sqrt((I_x- I_y)^2/4+I_xy^2);
% Center of the Mohr's Area Circle ====
I_xc =(I_x+ I_y)/2
I_yc = 0
Theta = atand(I_xy/(I_x-I_xc))/2
% Principal stresses ====================
I_1 = I_xc + R
I_2 = I_xc - R
% Max Value of I_xy : I_max =============
I_max = R
%===== Making Mohr's Circle =============
x1 = R*cos(x)+I_xc;
y1 = R*sin(x)+I_yc;
title('Make a Mohr Area Circle with R')
xlabel('Normal I')
grid on
axis ([I_xc-R, I_xc+R, -2-R, 2+R])
axis equal, hold on
% =========================================
plot([0 0], [-2-R, 2+R]) % y-축
plot([I_xc-2*R I_xc+2*R], [0 0]) % x-축
KSSV on 20 Dec 2023
Pick the points and use plot or line.
jeongyeon kim
jeongyeon kim on 20 Dec 2023
Can you make that commender?

Sign in to comment.

Answers (2)

lazymatlab on 20 Dec 2023
Edited: lazymatlab on 20 Dec 2023
Because the center is fixed and the lines would pass the center (because it's Mohr's circle), all you need is either x value of two intersections of line and circle. Then the coordinate of other side of the line is determined.
Add this below your code. Adjust x1 values as you want.
x1 = 1.799;
y1 = sqrt(R^2 - (x1 - I_xc)^2);
x2 = I_xc - (x1 - I_xc);
y2 = -y1;
plot([x1, x2], [y1, y2], 'm')

RAJA KUMAR on 20 Dec 2023
  1. Use the equation of straight line (x-x0)/(x1-x0) = (y-y0)/(y1-y0).
  2. Now Decide a variable to store the data for this straight line.
  3. Make sure the data you store for x,y are within the limits for the plot you want to show


Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!