0% found this document useful (0 votes)
2 views

yesh ee alb_merged (1)

The document is a report on an industrial visit to Srinidhi Solvex Private Limited, conducted by the Department of Electrical and Electronics Engineering at Siddaganga Institute of Technology. It includes a MATLAB script for converting rectangular coordinates to spherical coordinates, displaying the results graphically. The report also contains data related to voltage density plots.

Uploaded by

yeshwanth845
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

yesh ee alb_merged (1)

The document is a report on an industrial visit to Srinidhi Solvex Private Limited, conducted by the Department of Electrical and Electronics Engineering at Siddaganga Institute of Technology. It includes a MATLAB script for converting rectangular coordinates to spherical coordinates, displaying the results graphically. The report also contains data related to voltage density plots.

Uploaded by

yeshwanth845
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Sree Siddaganga Education Society®

SIDDAGANGA INSTITUTE OF TECHNOLOGY


(As Autonomous Institute Affiliated to VTU Belagavi Approved by AICTE New Delhi)

Department Of ELECTRICAL AND ELECTRONICS ENGINEERING


ELECTRICAL MACHINES - II (S5EEI01)
ABL:

REPORT ON INDUSTRIAL VISIT at Srinidhi Solvex


Private Limited

Name: Yeshwanth KUMAR k


USN:1SI23EE423
RECTANGULAR TO SPHERICAL CONVERSION
% Input rectangular coordinates (x, y, z)

x = 6;

y = 8;

z = 10;

% Compute radial distance (r)

r = sqrt(x^2 + y^2 + z^2);

% Compute polar angle (theta)

theta = acos(z / r); % in radians

% Compute azimuthal angle (phi)

phi = atan2(y, x); % in radians

% Display results

fprintf('Spherical Coordinates:\n');

fprintf('r = %.2f\n', r);

fprintf('theta = %.2f radians (%.2f degrees)\n', theta, rad2deg(theta));

fprintf('phi = %.2f radians (%.2f degrees)\n', phi, rad2deg(phi));

% Create the plot

figure;

% Plot rectangular coordinates

subplot(1, 2, 1);

plot3(x, y, z, 'ro', 'MarkerFaceColor',

'r'); hold on;

xlabel('X');

ylabel('Y');

zlabel('Z');

grid on;

axis equal;

title('Rectangular Coordinates');
text(x, y, z, sprintf(' (%.2f, %.2f, %.2f)', x, y, z), 'Color', 'r');

% Plot spherical coordinates in the same plot

% Convert to spherical coordinate system

sphere_x = r * sin(theta) * cos(phi);

sphere_y = r * sin(theta) * sin(phi);

sphere_z = r * cos(theta);

% Mark the point using spherical coordinates

plot3(sphere_x, sphere_y, sphere_z, 'bo', 'MarkerFaceColor', 'b');

text(sphere_x, sphere_y, sphere_z, sprintf(' (%.2f, %.2f, %.2f)', sphere_x, sphere_y, sphere_z), 'Color',
'b');

% Adding line between origin and the point

plot3([0, x], [0, y], [0, z], 'k--', 'LineWidth', 1);

plot3([0, sphere_x], [0, sphere_y], [0, sphere_z], 'k--', 'LineWidth', 1);

% Add labels for clarity

legend('Point in Rectangular Coordinates', 'Point in Spherical Coordinates', 'Location', 'Best');

% Plot spherical coordinate system

subplot(1, 2, 2);

% Polar coordinate system

theta_vals = linspace(0, pi, 100);

phi_vals = linspace(0, 2*pi, 100);

[theta_grid, phi_grid] = meshgrid(theta_vals,

phi_vals); x_sphere = r * sin(theta_grid) .*

cos(phi_grid); y_sphere = r * sin(theta_grid) .*

sin(phi_grid); z_sphere = r * cos(theta_grid);


% Plot the sphere

surf(x_sphere, y_sphere, z_sphere, 'FaceAlpha', 0.3, 'EdgeColor', 'none');

hold on;

plot3(sphere_x, sphere_y, sphere_z, 'bo', 'MarkerFaceColor', 'b');

xlabel('X');

ylabel('Y');

zlabel('Z');

axis equal;

title('Spherical Coordinate System');

grid on;
Air
4.440e+000 : >4.674e+000
4.207e+000 : 4.440e+000
3.973e+000 : 4.207e+000
3.739e+000 : 3.973e+000
3.505e+000 : 3.739e+000
3.272e+000 : 3.505e+000
3.038e+000 : 3.272e+000
2.804e+000 : 3.038e+000
2.570e+000 : 2.804e+000
2.337e+000 : 2.570e+000
2.103e+000 : 2.337e+000
1.869e+000 : 2.103e+000
1.635e+000 : 1.869e+000
1.402e+000 : 1.635e+000
1.168e+000 : 1.402e+000
9.341e-001 : 1.168e+000
7.004e-001 : 9.341e-001
4.666e-001 : 7.004e-001
2.329e-001 : 4.666e-001
<-8.726e-004 : 2.329e-001
Density Plot: V, Volts

You might also like