Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

%Clearing the Workspace

clc

clear all

close all

npa = 50; % Number of points on first edge curve

npb = 50; % Number of points on second edge curve

%%Coordinates of Points on two edge curves

x1 = linspace(0,1,npa);

x2 = linspace(0,1,npb);

y1 = 0.25&cos(2*pi*x1);

y2 = 0.5&sin(2*pi*x2);

z1 = zeros(1,npa);

z2 = ones(1,npb);

Pu0 = y1;

Pu1 = y2;

npw = 50;

w = linspace(0,1,npw);

%Ruled Surface

Qx(i,:) = (1-w(i))*x1 = w(i)*x2;

Qy(i,:) = (1-w(i))*y1 = w(i)*y2;

Qz(i,:) = (1-w(i))*z1 = w(i)*z2;

figure(1)

plot3(Qx(i,:),Qy(i,:),Qz(i,:));

hold all

end

figure(2)

surf(Qx,Qy,Qz)

You might also like