Assignment1

Assignment1 - '); %after solving A = (a^2+b^2); B =...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
% Tanisha Billups % Matlab (CSC 110-03) % Assignment 1 (line-ellipse intersection) % Due: February 4, 2011 % clear home %We need to set values or get a, b, r, m, and c (user inputs) m = input ('Enter value of slope: '); c = input ('Enter value of y-intercept: '); a = input ('Enter value of horizontal semi- axis: '); b = input ('Enter value of vertical semi-axis:
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: '); %after solving A = (a^2+b^2); B = (2*m*b^2); C = (b^4-(a^2)*(b^2)); D = B^2-(4*A*C); %assume that square root of quadratic is positive x1=(-B +sqrt(D))/(2*A); x2=(-B -sqrt(D))/(2*A); y1 = m*x1 +c; y2 = m*x2 +c; %create a vector v = [x1 y1 x2 y2]; disp(v); d...
View Full Document

Ask a homework question - tutors are online