Cody

Solution 886054

Submitted on 4 May 2016 by Peng Liu
  • Size: 42
  • This is the leading solution.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
P1 = [1 0]; P2 = [2 5]; P3 = [-1 2]; abc = [2 -1 -1]; O1 = Para3(P1,P2,P3); assert(isequal(O1,abc))

2   Pass
P1 = [1 0]; P2 = [2 5]; P3 = [-1 2]; vxvy = [0.25 -1.125]; [~,O2] = Para3(P1,P2,P3); assert(isequal(O2,vxvy))

3   Pass
i = [0 0]; j = [1 1]; k = [-1 1]; abc = [1 0 0]; tip = [0 0]; [Res,Ans] = Para3(i,j,k); assert(isequal(Res,abc)) assert(isequal(Ans,tip))

4   Pass
ptA = [-1 -5]; ptB = [2 4]; ptC = [3 -5]; exp1 = [-3 6 4]; exp2 = [1 7]; [coefficients,vertex] = Para3(ptA,ptB,ptC); assert(isequal(exp1,coefficients)) assert(isequal(exp2,vertex))