+ 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

7th Nov 2017, 12:03 AM
Joker - avatar
7 Answers
+ 13
Edit: My try - https://code.sololearn.com/c6dN8TkgQJdC/?ref=app By the way, this challenge was very easy.
7th Nov 2017, 4:08 PM
Swapnil Srivastava
Swapnil Srivastava - avatar
+ 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|
7th Nov 2017, 10:34 AM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 12
@Joker Sorry. Now corrected. is the code correct now?
13th Nov 2017, 4:34 PM
Swapnil Srivastava
Swapnil Srivastava - avatar
+ 4
I solved it using Heron's formula. difficulty: 4/10 https://code.sololearn.com/cgisCB6CQnAV/?ref=app
7th Nov 2017, 7:15 AM
Firdaus Al-Ghifari
Firdaus Al-Ghifari - avatar
+ 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.
12th Nov 2017, 3:30 AM
Joker - avatar
+ 1
@Swapnil :) yes
15th Nov 2017, 5:58 PM
Joker - avatar