|
Post by bencooper on Jun 11, 2020 14:17:25 GMT -5
I hope someone can help. I am writing a program to calculate area of a polyhedron using just the coordinates of the vertices and summing the triangular areas one at a time. The sum is the area of a single triangle. Other parts of the program not shown update the variables to enable calculation for large orders of polyhedron. If I don't separate the calculation down to p and q I get a syntax error - is there a limit on length of calculation (or line length?)) in LB? or am I doing something silly? there are a lot of brackets but I counted through many times before deciding to split the sum and … BINGO -worked perfectly! I don't normally have long calculations but this is sort of patterned on solution of a determinant of a matrix which are notorious for levels of calculation!
AREA=0 FOR ……… p=(x(1)*y(B)+x(B)*y(C)+x(C)*y(1))/2
q=(x(B)*y(1)+x(C)*y(B)+x(1)*y(C))/2
AREA=AREA+p-q NEXT …...
Thanks for usual rapid response !
|
|
|
Post by Chris Iverson on Jun 11, 2020 14:35:38 GMT -5
What's the code that comes back with a syntax error?
This doesn't error out for me:
AREA=AREA+((x(1)*y(B)+x(B)*y(C)+x(C)*y(1))/2)-((x(B)*y(1)+x(C)*y(B)+x(1)*y(C))/2)
|
|
|
Post by bencooper on Jun 16, 2020 3:07:48 GMT -5
Chris, thanks for response - I obviously can't count brackets! Ben
|
|