Message Boards Message Boards

4 Replies
1 Total Likes
View groups...
Share this post:

parsing bug? (fixed - initialization file damage)

Posted 10 years ago

I’m working on a program (attached) that uses the centroid of a set of points in 3D. In the function “centroid[list, n], if centroid[] is spelled properly, the function produces output that indicates the list is not being properly accessed. I left a copy of this output in the file. Print statements were inserted to display the problem. If I spell the function “centroyd[]”, it works as intended. I am using MMA 10.0.0 on a 2009 iMac running OSX 10.9.3 with 16 GB ram. When the problem occurred, I had only Firefox open in addition to MMA. Any ideas? Is the bug in MMA or in my head?

I noticed that my first attachment accidentally included some unnecessary graphics and additional programming, so I replaced it with the current version. If you downloaded the first one, please discard it to avoid confusion. My apologies.

POSTED BY: Gary Palmer
4 Replies
Posted 10 years ago

Using Mathematica 10.0.2 on Windows 7 the code appears to work resulting in the following output:

allPts before being passed to centroid[]: {{0.00809987,0.80996,0.482635},{0.582,0.18269,0.497061},{0.00318512,0.00947919,0.00954099},{0.33409,0.237663,0.00409993},{0.125128,0.168651,0.0668875}}

ptList in centroyd: {{0.00809987,0.80996,0.482635},{0.582,0.18269,0.497061},{0.00318512,0.00947919,0.00954099},{0.33409,0.237663,0.00409993},{0.125128,0.168651,0.0668875}}

centroyd: {0.210501,0.281688,0.212045}

ptList in centroid: {{0.00809987,0.80996,0.482635},{0.582,0.18269,0.497061},{0.00318512,0.00947919,0.00954099},{0.33409,0.237663,0.00409993},{0.125128,0.168651,0.0668875}}

centroid: {0.210501,0.281688,0.212045}
POSTED BY: Jim Baldwin
Posted 10 years ago

@Jim, interesting, thank you.

I should add that I don't recall ever encountering a verifiable bug in several years of using Mathematica, nor have I had any problems using it in OS X.

POSTED BY: Gary Palmer

Works fine for me 10.0.2 on MacOS 10.8.5.

You might try a "clean start" of Mathematica in case an initialization file has bad parameters.

POSTED BY: Bruce Miller
Posted 10 years ago

The clean start seems to have fixed the problem. I need to make a list of things to try when things go wrong. Thanks.

POSTED BY: Gary Palmer
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract