-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQ30_CycloidPlot.m
More file actions
59 lines (51 loc) · 2.33 KB
/
Q30_CycloidPlot.m
File metadata and controls
59 lines (51 loc) · 2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
% =========================================================================================
% FILE NAME: Q30_CycloidPlot.m
% AUTHOR: [Amey Thakur](https://github.com/Amey-Thakur)
% COURSE REPO: https://github.com/Amey-Thakur/COMPUTATIONAL-METHODS-AND-MODELING-FOR-ENGINEERING-APPLICATIONS
% RELEASE DATE: September 08, 2023
% LICENSE: Creative Commons Attribution 4.0 International (CC BY 4.0)
%
% DESCRIPTION:
% This script generates a precise parametric plot of a cycloid, the curve traced by a
% point on the circumference of a circular wheel rolling along a straight line.
%
% PROBLEM STATEMENT (Q30):
% A cycloid is the curve described by a point on the circumference of a circular
% wheel rolling along a straight line. The parametric equations of a cycloid are:
% x = r(phi - sin(phi))
% y = r(1 - cos(phi))
% Plot the cycloid for r = 10 inches and for 0 <= phi <= 4*pi.
%
% PARAMETRIC EQUATIONS:
% x = r * (phi - sin(phi))
% y = r * (1 - cos(phi))
%
% TECHNOLOGY STACK:
% - Programming Language: MATLAB (R2023a+)
% =========================================================================================
% --- Environment Initialization ---
clc;
clear;
close all;
% --- Configuration Parameters ---
r = 10; % Radius of the rolling wheel (inches)
phi = linspace(0, 4*pi, 1000); % Angular parameter range [0, 4*pi] (two full rotations)
% --- Parametric Computation ---
x = r * (phi - sin(phi));
y = r * (1 - cos(phi));
% --- Visualization Engine ---
figure('Color', 'w', 'Name', 'Parametric Cycloid Visualization');
plot(x, y, 'LineWidth', 2.5, 'Color', '#D95319');
% Aesthetics and Layout
grid on;
axis equal; % Ensures the geometric proportions are preserved (e.g., circular cross-section)
set(gca, 'FontName', 'Arial', 'FontSize', 10);
% Annotation and Labeling
title(['Cycloid Path Visualization (r = ', num2str(r), ' in)'], 'FontSize', 14, 'FontWeight', 'bold');
xlabel('Horizontal Displacement (x) [inches]', 'FontSize', 12);
ylabel('Vertical Displacement (y) [inches]', 'FontSize', 12);
% Annotating the rotational limits
text(x(1), y(1), ' \leftarrow Start (\phi = 0)', 'VerticalAlignment', 'bottom');
text(x(end), y(end), ' \leftarrow End (\phi = 4\pi)', 'VerticalAlignment', 'bottom');
% Professional Scholarly Footer
fprintf('Geometrical Insight: The resulting curve represents two full arching cycles of a point rolling on a 10-inch radius circle.\n');