+ 5
[Challenge] Triangles in 3d space!
IN THE PORGARMING LANGUAGE OF YOUR CHOOSEING Mathematics: Liner Alg or Vector Calc or Geometry Concepts: 3 variable vectors/graphs Given 3 random positive points in 3d space (v1 = (x1,y1,z1), v2 = (x2,y2,z2), v3=(x3,y3,z3)) determine the area of the triangle. Assume the units are in Meters. output: v1=(x1,y1,z1) v2=(x2,y2,z2) v3=(x3,y3,z3) area=A m^2 note: Please leave ur rating on difficulty. my solution difficulty: 3/10 avg diffculty: 3.6/10 https://code.sololearn.com/cKBDNDvaA60B/?ref=app
7 Answers
+ 13
Edit:
My try -
https://code.sololearn.com/c6dN8TkgQJdC/?ref=app
By the way, this challenge was very easy.
+ 28
m1) use distance formula to calculate every side & then use herons formula
m2) make use of vectors , simple take half of |cross product of any 2 side vectors|
+ 12
@Joker Sorry. Now corrected. is the code correct now?
+ 4
I solved it using Heron's formula.
difficulty: 4/10
https://code.sololearn.com/cgisCB6CQnAV/?ref=app
+ 2
@Swapnil Strivastava Good code and program, but I am sorry to inform you that your progarm returns the wrong value for points you have provided.
+ 1
@Swapnil :) yes