it was hard..nic problem
The test has rounding problems.
That was hard to me but not impossible. Great!
nice one
but it took so much of time
Good problem!
it's soooooo hard
function y = your_fcn_name(Points, Triangle)
for i = 1:size(Points,1)
po = Points(i,:);
p1=Triangle(1,:);
p2=Triangle(2,:);
p3=Triangle(3,:);
a = sqrt((p1(1)-p2(1))^2+(p1(2)-p2(2))^2);
b = sqrt((p1(1)-p3(1))^2+(p1(2)-p3(2))^2);
c = sqrt((p3(1)-p2(1))^2+(p3(2)-p2(2))^2);
d1=sqrt((p1(1)-po(1))^2+(p1(2)-po(2))^2);
d2=sqrt((p2(1)-po(1))^2+(p2(2)-po(2))^2);
d3=sqrt((p3(1)-po(1))^2+(p3(2)-po(2))^2);
y(i)=0;
alpha = rad2deg(acos((d1^2+d2^2-a^2)/(2*d1*d2)));
beta = rad2deg(acos((d1^2+d3^2-b^2)/(2*d1*d3)));
gamma = rad2deg(acos((d2^2+d3^2-c^2)/(2*d2*d3)));
if(alpha+beta+gamma==2*180)
y(i)=1;
end
end
end
why are competing against phony "Leading solutions" like this:
function ans = your_fcn_name3(varargin)
! echo "function assert(~)" > ./assert.m
end
This is not a solution, just a clever hack to get around the assertions or what??!!
Great!
295 Solvers
Duplicate each element of a vector.
523 Solvers
564 Solvers
402 Solvers
390 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!