1
$\begingroup$

I have code from Stan Wagon's Mathematica in Action, Chapter 17 (Great Circle Problem), but when I try to run it, it does not work. I have Mathematica 10. The code that does not run is shown below. Do I need some special library in order to run this code?

{g, g3D} = 
  RandomGreatCircleGraph[4, 
    Include3DPlot -> True, PlotStyle -> {Opacity[0.5], Yellow}];
g3D

SeedRandom[11]; 
{g, g3D} = 
  RandomGreatCircleGraph[4, 
    Include3DPlot -> True, PlotStyle -> {Opacity[0.5], Yellow}];

Show[g3D, ViewAngle -> 0.3, ImageSize -> 200]
$\endgroup$
10
  • 2
    $\begingroup$ When did you define RandomGreatCircleGraph? Is that a function in the book? $\endgroup$
    – JimB
    Oct 23, 2015 at 2:06
  • $\begingroup$ yes, that is a function in the book. This function is in read, and the author claims that and I do not know what is that, can you help me?: This disk contains some extra code used to generate the figures exactly as they appear in the book (for example, the COA group has the code for the "Chapter Opening Art"). That extra code appears in red. More important, several of the chapters rely on packages of code or other extra code. Such code appears at the top of each chapter in a group called "Code for Electronic Supplement". $\endgroup$
    – user35019
    Oct 23, 2015 at 2:09
  • 2
    $\begingroup$ For those who want to see the code in the book, see this. $\endgroup$ Oct 23, 2015 at 2:18
  • 2
    $\begingroup$ Any red you're seeing is quite likely due to shadowing, in that you tried to execute the example before executing the notebook's definitions, which are in a separate context. Restart Mathematica, execute everything within the "Code for Electronic Supplement" cell, and try again. $\endgroup$ Oct 23, 2015 at 2:25
  • 2
    $\begingroup$ Comments are not the place to ask further questions. Please post a new question concerning "how can I calculate the chromatic number for the great circle?" $\endgroup$
    – m_goldberg
    Oct 23, 2015 at 5:31

0