Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #input
- x=cellfun("str2double",strsplit(input('' ,'s')));
- y=cellfun("str2double",strsplit(input('' ,'s')));
- z=cellfun("str2double",strsplit(input('' ,'s')));
- #vec
- v1=y - x;
- v2=z - x;
- #print("%f %f",v1,v2);
- #a.b=|a|.|b|cos(temp)
- temp=abs(acosd((dot(v1,v2)/(norm(v1)*norm(v2))))); #rad deg
- printf("%f\n",temp);
- temp2=cross(v1,v2); #cross
- #printf("%f",temp2);
- temp3=1/2 *norm(temp2);
- printf("%f\n",temp3);
- temp2=temp2 ./ temp2(1);
- printf("%f %f %f",temp2(1),temp2(2),temp2(3));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement