// file ap.java Bob Connelly and Bob Terrell // 6/16/08 // This applet is based on the earlier tensegrity catalogue by Bob Connelly and // Allen Back, and contains the 'render' software // package from http://mrl.nyu.edu/~perlin and the 'Jama.Matrix' package // from http://math.nist.gov/javanumerics/jama. import java.applet.Applet; import java.awt.*; import java.awt.event.*; import java.util.*; import java.lang.*; import java.text.*; import render.*; import Jama.*; // a listing of the group elements as products of cycles /* a4 "1" 0 "(123)" =gn0 1 generator g_k in the book is g_{k-1} here "(132)" 2 "(12)(34)"=gn1 3 "(134)" 4 "(234)" 5 "(13)(24) =gn2 6 "(243)" 7 "(124)" 8 "(14)(23)" 9 "(142)" 10 "(143)" 11 a4z2 is a4 times 1 followed by times -1 = gn3 = element 12 */ /* s4 "1", 0 "(12)"=gn0 1 "(123)"=gn1 2 "(32)" 3 "(321)" 4 "(31)" 5 "(1234)"=gn2 6 "(423)" 7 "(4213)" 8 "(413)" 9 "(43)" 10 "(43)(12)" 11 "(42)(31)" 12 "(4132)" 13 "(432)" 14 "(4312)" 15 "(412)" 16 "(42)" 17 "(4321)" 18 "(431)" 19 "(41)" 20 "(421)" 21 "(4231)" 22 "(41)(32)" 23 s4z2 is s4 times 1 followed by times -1 = gn3 = element 24 */ /* a5 1 0 (123) 1gn0 (321) 2 (12)(34) 3gn1 (134) 4 (234) 5 (13)(24) 6gn2 (243) 7 (412) 8 (14)(23) 9 (142) 10 (143) 11 (12345) 12gn3 (13452) 13 (345) 14 (245) 15 (12453) 16 (13245) 17 (14532) 18 (145) 19 (14523) 20 (13)(45) 21 (23)(45) 22 (12)(45) 23 (13524) 24 (24)(53) 25 (12435) 26 (14235) 27 (14352) 28 (14)(35) 29 (354) 30 (12354) 31 (13542) 32 (12)(35) 33 (135) 34 (235) 35 (14253) 36 (14325) 37 (14)(25) 38 (13254) 39 (254) 40 (12543) 41 (125) 42 (13)(25) 43 (253) 44 (25)(34) 45 (12534) 46 (13425) 47 (15432) 48 (154) 49 (15423) 50 (153) 51 (15)(23) 52 (152) 53 (15234) 54 (15342) 55 (15)(34) 56 (15)(24) 57 (15243) 58 (15324) 59 a5z2 is a5 times 1 followed by times -1 = gn4 = element 60 */ public class ap extends Applet { String[] grpname = {"A4","A4Z2","S4","S4Z2","A5","A5Z2"}; int[] order = { 12, 24, 24, 48, 60, 120}; boolean[][] isinvolution = { { // a4 true, false, false, true, false, false, true, false, false, true, false, false }, { // a4z2 true, false, false, true, false, false, true, false, false, true, false, false, true, false, false, true, false, false, true, false, false, true, false, false }, { // s4 true, true, false, true, false, true, false, false, false, false, true, false, true, false, false, false, false, true, false, false, true, false, false, true }, { // s4z2 true, true, false, true, false, true, false, false, false, false, true, false, true, false, false, false, false, true, false, false, true, false, false, true, true, true, false, true, false, true, false, false, false, false, true, false, true, false, false, false, false, true, false, false, true, false, false, true }, { // a5 true, false, false, true, false, false, true, false, false, true, false, false, false, false, false, false, false, false, false, false, false, true, true, true, false, false, true, false, true, false, false, false, false, true, false, false, false, false, true, false, false, false, false, true, false, true, false, false, false, false, false, false, true, false, false, false, true, true, false, false }, { // a5z2 true, false, false, true, false, false, true, false, false, true, false, false, false, false, false, false, false, false, false, false, false, true, true, true, false, false, true, false, true, false, false, false, false, true, false, false, false, false, true, false, false, false, false, true, false, true, false, false, false, false, false, false, true, false, false, false, true, true, false, false, true, false, false, true, false, false, true, false, false, true, false, false, false, false, false, false, false, false, false, false, false, true, true, true, false, false, true, false, true, false, false, false, false, true, false, false, false, false, true, false, false, false, false, true, false, true, false, false, false, false, false, false, true, false, false, false, true, true, false, false } }; int[] gens = {3,4,3,4,4,5}; // number of generators of each group // to: to the power, the exponents // of generators to produce the group elements int[][][] to = { { // a4 {0,0,0}, {1,0,0}, {2,0,0}, {0,1,0}, {1,1,0}, {2,1,0}, {0,0,1}, {1,0,1}, {2,0,1}, {0,1,1}, {1,1,1}, {2,1,1} }, { // a4z2 {0,0,0,0}, {1,0,0,0}, {2,0,0,0}, {0,1,0,0}, {1,1,0,0}, {2,1,0,0}, {0,0,1,0}, {1,0,1,0}, {2,0,1,0}, {0,1,1,0}, {1,1,1,0}, {2,1,1,0}, {0,0,0,1}, {1,0,0,1}, {2,0,0,1}, {0,1,0,1}, {1,1,0,1}, {2,1,0,1}, {0,0,1,1}, {1,0,1,1}, {2,0,1,1}, {0,1,1,1}, {1,1,1,1}, {2,1,1,1} }, { // s4 (element #2 of s4 is gen_0^0 gen_1^1 gen_2^0 etc) {0,0,0}, {1,0,0}, {0,1,0}, {1,1,0}, {0,2,0}, {1,2,0}, {0,0,1}, {1,0,1}, {0,1,1}, {1,1,1}, {0,2,1}, {1,2,1}, {0,0,2}, {1,0,2}, {0,1,2}, {1,1,2}, {0,2,2}, {1,2,2}, {0,0,3}, {1,0,3}, {0,1,3}, {1,1,3}, {0,2,3}, {1,2,3} }, { // s4z2 {0,0,0,0}, {1,0,0,0}, {0,1,0,0}, {1,1,0,0}, {0,2,0,0}, {1,2,0,0}, {0,0,1,0}, {1,0,1,0}, {0,1,1,0}, {1,1,1,0}, {0,2,1,0}, {1,2,1,0}, {0,0,2,0}, {1,0,2,0}, {0,1,2,0}, {1,1,2,0}, {0,2,2,0}, {1,2,2,0}, {0,0,3,0}, {1,0,3,0}, {0,1,3,0}, {1,1,3,0}, {0,2,3,0}, {1,2,3,0}, {0,0,0,1}, {1,0,0,1}, {0,1,0,1}, {1,1,0,1}, {0,2,0,1}, {1,2,0,1}, {0,0,1,1}, {1,0,1,1}, {0,1,1,1}, {1,1,1,1}, {0,2,1,1}, {1,2,1,1}, {0,0,2,1}, {1,0,2,1}, {0,1,2,1}, {1,1,2,1}, {0,2,2,1}, {1,2,2,1}, {0,0,3,1}, {1,0,3,1}, {0,1,3,1}, {1,1,3,1}, {0,2,3,1}, {1,2,3,1} }, { // a5 {0,0,0,0}, {1,0,0,0}, {2,0,0,0}, {0,1,0,0}, {1,1,0,0}, {2,1,0,0}, {0,0,1,0}, {1,0,1,0}, {2,0,1,0}, {0,1,1,0}, {1,1,1,0}, {2,1,1,0}, {0,0,0,1},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},{1,0,0,4,0},{2,0,0,4,0},{0,1,0,4,0},{1,1,0,4,0},{2,1,0,4,0}, {0,0,1,4,0},{1,0,1,4,0},{2,0,1,4,0},{0,1,1,4,0},{1,1,1,4,0},{2,1,1,4,0}, {0,0,0,0,1},{1,0,0,0,1},{2,0,0,0,1},{0,1,0,0,1},{1,1,0,0,1},{2,1,0,0,1}, {0,0,1,0,1},{1,0,1,0,1},{2,0,1,0,1},{0,1,1,0,1},{1,1,1,0,1},{2,1,1,0,1}, {0,0,0,1,1},{1,0,0,1,1},{2,0,0,1,1},{0,1,0,1,1},{1,1,0,1,1},{2,1,0,1,1}, {0,0,1,1,1},{1,0,1,1,1},{2,0,1,1,1},{0,1,1,1,1},{1,1,1,1,1},{2,1,1,1,1}, {0,0,0,2,1},{1,0,0,2,1},{2,0,0,2,1},{0,1,0,2,1},{1,1,0,2,1},{2,1,0,2,1}, {0,0,1,2,1},{1,0,1,2,1},{2,0,1,2,1},{0,1,1,2,1},{1,1,1,2,1},{2,1,1,2,1}, {0,0,0,3,1},{1,0,0,3,1},{2,0,0,3,1},{0,1,0,3,1},{1,1,0,3,1},{2,1,0,3,1}, {0,0,1,3,1},{1,0,1,3,1},{2,0,1,3,1},{0,1,1,3,1},{1,1,1,3,1},{2,1,1,3,1}, {0,0,0,4,1},{1,0,0,4,1},{2,0,0,4,1},{0,1,0,4,1},{1,1,0,4,1},{2,1,0,4,1}, {0,0,1,4,1},{1,0,1,4,1},{2,0,1,4,1},{0,1,1,4,1},{1,1,1,4,1},{2,1,1,4,1} } }; int[] reps = {5,9,6,11,6,11}; // 1+number of irreducible representations // of each group // so that the numbering will match the book final boolean is3dfaithful[][] = { // is3dfaithful[group 0][rep 4] is true, etc {false,false,false,false, true}, //a4 {false,false,false,false,false,false,false,false,true}, //a4z2 {false,false,false,false, true, true}, //s4 {false,false,false,false,false,false,false,false,false, true, true},//s4z2 {false,false, true, true,false,false}, //a5 {false,false,false,false,false,false,false, true, true,false,false},//a5z2 }; final boolean cx[][] = // true: is 2x2 real version of a complex rep { { // a4 false, false, true, true, false}, { // a4z2 false, false, true, true, false, false, true, true, false}, { // s4 false, false, false, false, false, false}, { // s4z2 false, false, false, false, false, false, false, false, false, false, false}, { // a5 false, false, false, false, false, false}, { // a5z2 false, false, false, false, false, false, false, false, false, false, false} }; static final double rt3 = Math.sqrt(3.0), rt5 = Math.sqrt(5.0), rt2 = Math.sqrt(2.0), tau = (1.0+rt5)/2.0, tap = (1.0-rt5)/2.0; // mx[0][4][gn][i][j] is (i,j) entry of rep#4 of generator#gn of group 0 double mx[][][][][] = { { // a4 { // rep 0, false, copy of 1 {{1.0}},{{1.0}},{{1.0}} }, { // rep 1 {{1.0}},{{1.0}},{{1.0}} }, { // rep 2, real 2x2 version {{ -0.5, -rt3/2.0}, { rt3/2.0, -0.5}}, {{ 1.0, 0.0}, { 0.0, 1.0}}, {{ 1.0, 0.0}, { 0.0, 1.0}} }, { // rep 3, real 2x2 version {{ -0.5, rt3/2.0}, {-rt3/2.0, -0.5}}, {{ 1.0, 0.0}, { 0.0, 1.0}}, {{ 1.0, 0.0}, { 0.0, 1.0}} }, { // rep 4 {{ 0.0, 1.0, 0.0}, { 0.0, 0.0,-1.0}, {-1.0, 0.0, 0.0}}, {{ 1.0, 0.0, 0.0}, { 0.0,-1.0, 0.0}, { 0.0, 0.0,-1.0}}, {{-1.0, 0.0, 0.0}, { 0.0, 1.0, 0.0}, { 0.0, 0.0,-1.0}} } }, { // a4z2 { // rep 0, false, copy of 1 {{1.0}},{{1.0}},{{1.0}},{{1.0}} }, { // rep 1 {{1.0}},{{1.0}},{{1.0}},{{1.0}} }, { // rep 2, real 2x2 version {{ -0.5, -rt3/2.0}, { rt3/2.0, -0.5}}, {{ 1.0, 0.0}, { 0.0, 1.0}}, {{ 1.0, 0.0}, { 0.0, 1.0}}, {{ 1.0, 0.0}, { 0.0, 1.0}} }, { // rep 3, real 2x2 version {{ -0.5, rt3/2.0}, {-rt3/2.0, -0.5}}, {{ 1.0, 0.0}, { 0.0, 1.0}}, {{ 1.0, 0.0}, { 0.0, 1.0}}, {{ 1.0, 0.0}, { 0.0, 1.0}} }, { // rep 4 {{ 0.0, 1.0, 0.0}, { 0.0, 0.0,-1.0}, {-1.0, 0.0, 0.0}}, {{ 1.0, 0.0, 0.0}, { 0.0,-1.0, 0.0}, { 0.0, 0.0,-1.0}}, {{-1.0, 0.0, 0.0}, { 0.0, 1.0, 0.0}, { 0.0, 0.0,-1.0}}, {{ 1.0, 0.0, 0.0}, { 0.0, 1.0, 0.0}, { 0.0, 0.0, 1.0}} }, { // rep 5 {{ 1.0}},{{ 1.0}},{{ 1.0}},{{-1.0}} }, { // rep 6, real 2x2 version {{ -0.5, -rt3/2.0}, { rt3/2.0, -0.5}}, {{ 1.0, 0.0}, { 0.0, 1.0}}, {{ 1.0, 0.0}, { 0.0, 1.0}}, {{-1.0, 0.0}, { 0.0,-1.0}} }, { // rep 7, real 2x2 version {{ -0.5, rt3/2.0}, {-rt3/2.0, -0.5}}, {{ 1.0, 0.0}, { 0.0, 1.0}}, {{ 1.0, 0.0}, { 0.0, 1.0}}, {{-1.0, 0.0}, { 0.0,-1.0}} }, { // rep 8 {{ 0.0, 1.0, 0.0}, { 0.0, 0.0,-1.0}, {-1.0, 0.0, 0.0}}, {{ 1.0, 0.0, 0.0}, { 0.0,-1.0, 0.0}, { 0.0, 0.0,-1.0}}, {{-1.0, 0.0, 0.0}, { 0.0, 1.0, 0.0}, { 0.0, 0.0,-1.0}}, {{-1.0, 0.0, 0.0}, { 0.0,-1.0, 0.0}, { 0.0, 0.0,-1.0}} } }, { // s4 { // rep 0, false, copy of 1 {{1.0}},{{1.0}},{{1.0}} }, { // rep 1 {{1.0}},{{1.0}},{{1.0}} }, { // rep 2 {{-1.0}},{{ 1.0}},{{ -1.0}} }, { // rep 3 {{-1.0, 0.0}, { 0.0, 1.0}}, {{ -0.5, -rt3/2.0}, { rt3/2.0, -0.5}}, {{ 0.5, -rt3/2.0}, {-rt3/2.0, -0.5}} }, { // rep 4 {{-1.0, 0.0, 0.0}, // rep 4 of g(12) { 0.0, 0.0, 1.0}, { 0.0, 1.0, 0.0}}, {{ 0.0, 1.0, 0.0}, // g(123) { 0.0, 0.0,-1.0}, {-1.0, 0.0, 0.0}}, {{ 0.0, 0.0,-1.0}, // g(1234) { 0.0, 1.0, 0.0}, { 1.0, 0.0, 0.0}} }, { // rep 5 {{ 1.0, 0.0, 0.0}, { 0.0, 0.0,-1.0}, { 0.0,-1.0, 0.0}}, {{ 0.0, 1.0, 0.0}, { 0.0, 0.0,-1.0}, {-1.0, 0.0, 0.0}}, {{ 0.0, 0.0, 1.0}, { 0.0,-1.0, 0.0}, {-1.0, 0.0, 0.0}} } }, { // s4z2 { // rep 0, false, copy of 1 {{1.0}},{{1.0}},{{1.0}},{{1.0}} }, { // rep 1 {{1.0}},{{1.0}},{{1.0}},{{1.0}} }, { // rep 2 {{-1.0}},{{ 1.0}},{{ -1.0}},{{1.0}} }, { // rep 3 {{-1.0, 0.0}, { 0.0, 1.0}}, {{ -0.5, -rt3/2.0}, { rt3/2.0, -0.5}}, {{ 0.5, -rt3/2.0}, {-rt3/2.0, -0.5}}, {{ 1.0, 0.0}, { 0.0, 1.0}} }, { // rep 4 {{-1.0, 0.0, 0.0}, { 0.0, 0.0, 1.0}, { 0.0, 1.0, 0.0}}, {{ 0.0, 1.0, 0.0}, { 0.0, 0.0,-1.0}, {-1.0, 0.0, 0.0}}, {{ 0.0, 0.0,-1.0}, { 0.0, 1.0, 0.0}, { 1.0, 0.0, 0.0}}, {{ 1.0, 0.0, 0.0}, { 0.0, 1.0, 0.0}, { 0.0, 0.0, 1.0}} }, { // rep 5 {{ 1.0, 0.0, 0.0}, { 0.0, 0.0,-1.0}, { 0.0,-1.0, 0.0}}, {{ 0.0, 1.0, 0.0}, { 0.0, 0.0,-1.0}, {-1.0, 0.0, 0.0}}, {{ 0.0, 0.0, 1.0}, { 0.0,-1.0, 0.0}, {-1.0, 0.0, 0.0}}, {{ 1.0, 0.0, 0.0}, { 0.0, 1.0, 0.0}, { 0.0, 0.0, 1.0}} }, { // rep 6 {{1.0}},{{1.0}},{{1.0}},{{-1.0}} }, { // rep 7 {{-1.0}},{{ 1.0}},{{ -1.0}},{{-1.0}} }, { // rep 8 {{-1.0, 0.0}, { 0.0, 1.0}}, {{ -0.5, -rt3/2.0}, { rt3/2.0, -0.5}}, {{ 0.5, -rt3/2.0}, {-rt3/2.0, -0.5}}, {{-1.0, 0.0}, { 0.0,-1.0}} }, { // rep 9 {{-1.0, 0.0, 0.0}, { 0.0, 0.0, 1.0}, { 0.0, 1.0, 0.0}}, {{ 0.0, 1.0, 0.0}, { 0.0, 0.0,-1.0}, {-1.0, 0.0, 0.0}}, {{ 0.0, 0.0,-1.0}, { 0.0, 1.0, 0.0}, { 1.0, 0.0, 0.0}}, {{-1.0, 0.0, 0.0}, { 0.0,-1.0, 0.0}, { 0.0, 0.0,-1.0}} }, { // rep 10 {{ 1.0, 0.0, 0.0}, { 0.0, 0.0,-1.0}, { 0.0,-1.0, 0.0}}, {{ 0.0, 1.0, 0.0}, { 0.0, 0.0,-1.0}, {-1.0, 0.0, 0.0}}, {{ 0.0, 0.0, 1.0}, { 0.0,-1.0, 0.0}, {-1.0, 0.0, 0.0}}, {{-1.0, 0.0, 0.0}, { 0.0,-1.0, 0.0}, { 0.0, 0.0,-1.0}} }, }, { // a5 { {{1.0}},{{1.0}},{{1.0}},{{1.0}} }, { {{1.0}},{{1.0}},{{1.0}},{{1.0}} }, { // rep 2 {{ 0.0, 1.0, 0.0}, { 0.0, 0.0, 1.0}, { 1.0, 0.0, 0.0}}, {{-1.0, 0.0, 0.0}, { 0.0,-1.0, 0.0}, { 0.0, 0.0, 1.0}}, {{ 1.0, 0.0, 0.0}, { 0.0,-1.0, 0.0}, { 0.0, 0.0,-1.0}}, {{ 1.0/2, tau/2, tap/2}, {-tau/2,-tap/2,-1.0/2}, { tap/2, 1.0/2, tau/2}} }, { // rep 3 {{ 0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0, 0.0, 0.0, 0.0,-1.0}}, {{ -1.0/8, rt3*rt5/8, -rt3/4, rt3*tap/4, rt3*tau/4}, { rt3*rt5/8, 1.0/8, -rt5/4,(3.0+rt5)/8,(-3.0+rt5)/8}, { rt3/4, rt5/4, 0.0, -1.0/2, -1.0/2}, { rt3*tap/4,(3.0+rt5)/8, 1.0/2, 1.0/2, 0.0}, { -rt3*tau/4,(3.0-rt5)/8, -1.0/2, 0, -1.0/2}} } }, { // a5z2 { {{1.0}},{{1.0}},{{1.0}},{{1.0}},{{1.0}} }, { {{1.0}},{{1.0}},{{1.0}},{{1.0}},{{1.0}} }, { // rep 2 {{ 0.0, 1.0, 0.0}, { 0.0, 0.0, 1.0}, { 1.0, 0.0, 0.0}}, {{-1.0, 0.0, 0.0}, { 0.0,-1.0, 0.0}, { 0.0, 0.0, 1.0}}, {{ 1.0, 0.0, 0.0}, { 0.0,-1.0, 0.0}, { 0.0, 0.0,-1.0}}, {{ 1.0/2, tau/2, tap/2}, {-tau/2,-tap/2,-1.0/2}, { tap/2, 1.0/2, tau/2}}, {{ 1.0, 0.0, 0.0}, { 0.0, 1.0, 0.0}, { 0.0, 0.0, 1.0}} }, { // rep 3 {{ 0.0, 1.0, 0.0}, { 0.0, 0.0, 1.0}, { 1.0, 0.0, 0.0}}, {{-1.0, 0.0, 0.0}, { 0.0,-1.0, 0.0}, { 0.0, 0.0, 1.0}}, {{ 1.0, 0.0, 0.0}, { 0.0,-1.0, 0.0}, { 0.0, 0.0,-1.0}}, {{ 1.0/2, tap/2, tau/2}, {-tap/2,-tau/2,-1.0/2}, { tau/2, 1.0/2, tap/2}}, {{ 1.0, 0.0, 0.0}, { 0.0, 1.0, 0.0}, { 0.0, 0.0, 1.0}} }, { // rep 4 {{ 0.0, 0.0, 1.0, 0.0}, { 1.0, 0.0, 0.0, 0.0}, { 0.0, 1.0, 0.0, 0.0}, { 0.0, 0.0, 0.0, 1.0}}, {{-1.0, 0.0, 0.0, 0.0}, { 0.0, 1.0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4, 1.0/4,-rt5/4}, { 1.0/4, 1.0/4, -3.0/4,-rt5/4}, {-1.0/4, 3.0/4, -1.0/4, rt5/4}, { rt5/4, rt5/4, rt5/4,-1.0/4}}, {{-1.0, 0.0, 0.0, 0.0}, { 0.0,-1.0, 0.0, 0.0}, { 0.0, 0.0,-1.0, 0.0}, { 0.0, 0.0, 0.0,-1.0}} }, { // rep 10 {{ -1.0/2, rt3/2, 0.0, 0.0, 0.0}, { -rt3/2,-1.0/2, 0.0, 0.0, 0.0}, { 0.0, 0.0, 0.0, 1.0, 0.0}, { 0.0, 0.0, 0.0, 0.0, 1.0}, { 0.0, 0.0, 1.0, 0.0, 0.0}}, {{ 1.0, 0.0, 0.0, 0.0, 0.0}, { 0.0, 1.0, 0.0, 0.0, 0.0}, { 0.0, 0.0,-1.0, 0.0, 0.0}, { 0.0, 0.0, 0.0,-1.0, 0.0}, { 0.0, 0.0, 0.0, 0.0, 1.0}}, {{ 1.0, 0.0, 0.0, 0.0, 0.0}, { 0.0, 1.0, 0.0, 0.0, 0.0}, { 0.0, 0.0, 1.0, 0.0, 0.0}, { 0.0, 0.0, 0.0,-1.0, 0.0}, { 0.0, 0.0, 0.0, 0.0,-1.0}}, {{ -1.0/8, rt3*rt5/8, -rt3/4, rt3*tap/4, rt3*tau/4}, { rt3*rt5/8, 1.0/8, -rt5/4,(3.0+rt5)/8,(-3.0+rt5)/8}, { rt3/4, rt5/4, 0.0, -1.0/2, -1.0/2}, { rt3*tap/4,(3.0+rt5)/8, 1.0/2, 1.0/2, 0.0}, { -rt3*tau/4,(3.0-rt5)/8, -1.0/2, 0, -1.0/2}}, {{ -1.0, 0.0, 0.0, 0.0, 0.0}, { 0.0, -1.0, 0.0, 0.0, 0.0}, { 0.0, 0.0,-1.0, 0.0, 0.0}, { 0.0, 0.0, 0.0,-1.0, 0.0}, { 0.0, 0.0, 0.0, 0.0,-1.0}} } } }; int[][] deg = // of the reps. Note extra initial 1 to match book numbering { {1,1,2,2,3}, {1,1,2,2,3,1,2,2,3}, {1,1,1,2,3,3}, {1,1,1,2,3,3,1,1,2,3,3}, {1,1,3,3,4,5}, {1,1,3,3,4,5,1,3,3,4,5} }; // cables are taken from the online catalogue except a5z2 String[][] cables = { {"{(134),(243)}", "{(124), (14)(23)}"}, //a4 {"{(124),-(13)(24)}", "{(142),-(134)}", "{-(243),(12)(34)}", //a4z2 "{-(234),-(12)(34)}", "{-(234),-(134)}"}, {"{(1423),(234)}", "{(12),(143)}", "{(1423),(13)}", "{(1243),(1324)}"}, //s4 {"{-(1342),(34)}", "{-(132),-(14)}", "{-(14),(1234)}", "{-(1423),(1234)}", "{-(1423),-(142)}", "{-(132),(14)}", "{(1324),-(123)}"}, //s4z2 {"{(134),(23)(45)}", "{(15)(24),(14532)}", "{(12354),(143)}", "{(12354),(145)}", "{(12354),(14235)}", "{(15243),(15)(34)}", "{(142),(354)}", "{(14325),(14253)}"}, //a5 {"{-(134),(23)(45)}", "{-(15)(24),(14532)}", "{-(12354),(143)}", // new a5z2 (-,+)a5 "{-(12354),(145)}", "{-(12354),(14235)}", "{-(15243),(15)(34)}", "{-(142),(354)}X", "{-(14325),(14253)}", "{(134),-(23)(45)}", "{(15)(24),-(14532)}X", "{(12354),-(143)}", // (+,-)a5 "{(12354),-(145)}", "{(12354),-(14235)}", "{(15243),-(15)(34)}", "{(142),-(354)}", "{(14325),-(14253)}", "{-(134),-(23)(45)}", "{-(15)(24),-(14532)}", "{-(12354),-(143)}", // (-,-)a5 "{-(12354),-(145)}", "{-(12354),-(14235)}X", "{-(15243),-(15)(34)}", "{-(142),-(354)}", "{-(14325),-(14253)}"} }; int[][][] cablnumb3rs = { { // a4 { 4, 7},{ 8, 9} }, { // a4z2 { 8,18},{10,16},{19, 3},{17,15},{17,16} }, { // s4 {22, 7},{ 1,19},{22, 5},{15,13} }, { // s4z2 {32,10},{28,44},{44, 6},{46, 6},{46,45},{28,20},{13,26} }, { // a5 { 4,22},{57,18},{31,11},{31,19},{31,27},{58,56},{10,30},{37,36} }, { // new a5z2(-,+),(+,-),(-,-) {64,22},{117,18},{91,11},{91,19},{91,27},{118,56}, {70,30},{97,36}, { 4,92}, {57,78},{31,71},{31,79},{31,87}, {58,116},{10,90},{37,96}, {64,92},{117,78},{91,71},{91,79},{91,87},{118,116},{70,90},{97,96} } }; // struts are taken from the online catalogue, except a5z2 String[][][] struts = { { // a4 {"(123)","(12)(34)","(14)(23)"}, {"(123)","(13)(24)","(143)"} }, { // a4z2 {"(123)", "-1", "(12)(34)", "-(12)(34)", "(243)", "-(143)", "-(142)", "-(243)", "(13)(24)"}, {"-(123)", "(123)", "-1", "(12)(34)", "-(12)(34)", "(14)(23)", "(134)", "-(142)", "-(14)(23)"}, {"-(123)", "(123)", "-1", "-(12)(34)", "(14)(23)", "(134)", "(243)", "-(143)"}, {"-(123)", "(123)", "-1", "(12)(34)", "(14)(23)", "(143)", "-(13)(24)", "(243)", "-(134)"}, {"-(123)", "-(14)(23)", "(123)", "-1", "(12)(34)", "-(12)(34)", "(14)(23)", "(134)"} }, { // s4 {"(14)(23)", "(13)", "(12)", "(1342)", "(124)", "(23)", "(12)(34)", "(143)", "(34)"}, {"(14)(23)", "(1324)", "(13)", "(1243)", "(124)", "(23)", "(12)(34)", "(234)", "(34)"}, {"(14)(23)", "(124)", "(12)", "(1243)", "(24)", "(1234)", "(13)(24)", "(14)", "(123)", "(12)(34)"}, {"(13)", "(12)", "(124)", "(1234)", "(13)(24)", "(12)(34)"} }, { // s4z2 {"(12)(34)", "-(24)", "(143)X", "-(14)", "-(13)(24)X","-(34)X", "(13)(24)", "(1234)X", "(23)X", "-(132)X", "-(1432)X", "-(134)", "(14)(23)X", "(132)X", "(1243)X", "(12)", "(13)X", "-(14)(23)X", "(1423)", "-(12)X", "-1X", "-(1423)X", "-(12)(34)X"}, {"(12)(34)X", "-(24)X", "-(13)(24)X", "(34)X", "(143)X", "-(13)X", "-(1342)X", "(1234)X", "(23)X", "-(1234)X", "-(134)X", "(14)(23)X", "(123)", "(1342)X", "(12)X", "-(243)X", "-(23)X", "-(14)(23)X", "(14)", "(243)", "-1"}, {"(12)(34)", "-(13)(24)X","(34)", "-(12)X", "(143)X", "-(24)X", "(13)(24)X", "(243)X", "-(1342)", "(23)X", "-(132)X", "-(1432)X", "-(134)", "(14)(23)", "(1243)X", "(13)", "-(23)", "(14)X", "(1423)X", "-(14)(23)X","-1X", "-(1423)X", "-(12)(34)X"}, {"(12)(34)", "(243)X", "-(13)(24)X", "(34)X", "-(14)X", "-(24)X", "-(34)", "(13)(24)", "-(1342)X", "(23)X", "-(123)X", "-(1432)X", "(14)(23)", "(1342)X", "(24)", "(1423)X", "-(14)(23)X","-1X", "-(12)(34)X"}, {"(243)X", "-(13)(24)X","-(14)X", "-(23)X", "(34)X", "-(34)X", "(13)(24)X", "(12)(34)X", "-(1342)X", "(1234)X", "(23)X", "(123)X", "-(132)X", "-(134)X", "(12)X", "-(12)", "(14)X", "(1423)X", "(142)X", "-1X", "-(12)(34)X"}, {"(34)X", "-(14)", "(143)X", "-(23)X", "-(24)", "(13)(24)X", "-(1243)X", "(1234)X", "-(13)(24)X", "(23)X", "(132)", "-(1432)X", "-(134)X", "(14)(23)X", "-(13)X", "(1243)X", "(12)X", "-(243)X", "(243)", "-1", "-(14)(23)X"}, {"-(13)(24)X", "(34)X", "-(14)X", "(143)X", "-(23)X", "(13)(24)X", "(12)(34)X", "-(1342)", "(1432)X", "(23)X", "-(34)X", "-(134)X", "(123)X", "(24)X", "(12)X", "-(142)X", "(142)X", "-(12)X", "-1X", "-(12)(34)X"} }, { // a5 {"(123)", "(13)(24)", "(14523)", "(25)(34)", "(13)(25)", "(153)", "(14)(23)", "(14352)", "(12543)", "(254)", "(12435)", "(14253)", "(12)(35)", "(14532)", "(15)(34)", "(354)", "(152)", "(13542)", "(12)(45)", "(24)(35)", "(15432)"}, {"(123)", "(13)(24)", "(14523)", "(25)(34)", "(12435)", "(153)", "(14)(23)", "(13)(45)", "(23)(45)", "(254)", "(14253)", "(14)(25)", "(13542)", "(134)", "(12)(45)", "(235)", "(15)(23)X", "(14235)", "(15243)", "(145)", "(12543)"}, {"(123)", "(13)(24)", "(14523)", "(25)(34)", "(15342)", "(14)(23)", "(13)(45)", "(23)(45)", "(135)", "(254)", "(13524)", "(14)(25)", "(13542)", "(12)(45)", "(15)(24)", "(235)", "(15)(23)", "(14235)", "(15243)", "(154)", "(12543)"}, {"(123)", "(13)(24)", "(14523)X", "(13)(25)", "(14)(32)", "(14352)X", "(135)", "(13452)", "(15342)", "(254)", "(12)(35)", "(15)(34)", "(354)", "(12)(34)", "(13245)", "(14)(25)", "(234)", "(12)(45)", "(15)(23)", "(14235)", "(15243)"}, {"(123)", "(13)(24)", "(13)(25)", "(14)(32)", "(14352)", "(23)(45)", "(12543)", "(15342)", "(245)", "(14)(25)", "(143)", "(15)(24)", "(235)X", "(154)"}, {"(13)(24)", "(25)(34)", "(14)(23)", "(12435)", "(23)(45)", "(14352)", "(153)", "(123)", "(12543)", "(254)", "(14532)X", "(354)", "(14253)", "(12)(34)", "(14)(25)", "(13542)", "(234)", "(235)", "(14)(35)", "(15432)X", "(13)(45)"}, {"(13)(24)", "(13)(25)", "(14352)", "(153)", "(12543)", "(254)", "(12)(34)", "(13245)", "(12)(35)"}, {"(13)(24)", "(13254)", "(25)(34)", "(13)(45)", "(15342)", "(135)", "(123)", "(13452)", "(254)", "(14)(25)X", "(13542)", "(143)", "(15)(24)", "(12)(45)", "(15243)"} }, { // new a5z2(+,-,+,-,+,-) In each strutlist adjoin (-c1), (-c2), and (-1). //begin copy 1 of 3, for the (-,+)a5 cables {"(123)X", "(13)(24)X", "(14523)X", "(25)(34)X", "(13)(25)X", "(153)X", "(14)(23)X", "(14352)X", "(12543)X", "(254)X", "(12435)X", "(14253)X", "(12)(35)X", "(14532)X", "(15)(34)X", "(354)X", "(152)", "(13542)X", "(12)(45)X", "(24)(35)X", "(15432)X", "-(123)X", "-(13)(24)X","-(14523)X", "-(25)(34)X", "-(13)(25)X","-(153)X", "-(14)(23)X", "-(14352)X", "-(12543)X", "-(254)X", "-(12435)X", "-(14253)X", "-(12)(35)X", "-(14532)X", "-(15)(34)X", "-(354)X", "-(152)X", "-(13542)X", "-(12)(45)X", "-(24)(35)X","-(15432)X", "(134)", "-(23)(45)", "-1"}, {"(123)", "(13)(24)", "(14523)", "(25)(34)", "(12435)", "(153)", "(14)(23)", "(13)(45)", "(23)(45)X", "(254)", "(14253)", "(14)(25)", "(13542)X", "(134)", "(12)(45)", "(235)", "(15)(23)X", "(14235)", "(15243)X", "(145)X", "(12543)X", "-(123)", "-(13)(24)", "-(14523)", "-(25)(34)", "-(12435)", "-(153)X", "-(14)(23)", "-(13)(45)", "-(23)(45)", "-(254)X", "-(14253)", "-(14)(25)", "-(13542)", "-(134)", "-(12)(45)X", "-(235)", "-(15)(23)", "-(14235)", "-(15243)", "-(145)", "-(12543)", "(15)(24)", "-(14532)", "-1"}, {"(123)X", "(13)(24)", "(14523)X", "(25)(34)X", "(15342)", "(14)(23)", "(13)(45)X", "(23)(45)", "(135)", "(254)", "(13524)", "(14)(25)", "(13542)X", "(12)(45)X", "(15)(24)", "(235)", "(15)(23)X", "(14235)X", "(15243)", "(154)", "(12543)X", "-(123)X", "-(13)(24)X","-(14523)", "-(25)(34)X", "-(15342)", "-(14)(23)X", "-(13)(45)X", "-(23)(45)", "-(135)X", "-(254)", "-(13524)", "-(14)(25)X", "-(13542)", "-(12)(45)X","-(15)(24)X", "-(235)", "-(15)(23)", "-(14235)X", "-(15243)", "-(154)X", "-(12543)", "(12354)", "-(143)", "-1"}, {"(123)", "(13)(24)", "(14523)", "(13)(25)", "(14)(32)", "(14352)", "(135)", "(13452)", "(15342)", "(254)", "(12)(35)", "(15)(34)", "(354)", "(12)(34)", "(13245)", "(14)(25)", "(234)", "(12)(45)", "(15)(23)", "(14235)", "(15243)", "-(123)", "-(13)(24)", "-(14523)", "-(13)(25)", "-(14)(32)", "-(14352)", "-(135)", "-(13452)", "-(15342)", "-(254)", "-(12)(35)", "-(15)(34)", "-(354)", "-(12)(34)", "-(13245)", "-(14)(25)", "-(234)", "-(12)(45)", "-(15)(23)", "-(14235)", "-(15243)", "(12354)", "-(145)", "-1"}, {"(123)", "(13)(24)", "(13)(25)", "(14)(32)", "(14352)X", "(23)(45)", "(12543)X", "(15342)", "(245)", "(14)(25)", "(143)X", "(15)(24)", "(235)", "(154)", "-(123)", "-(13)(24)X","-(13)(25)", "-(14)(32)", "-(14352)", "-(23)(45)X", "-(12543)", "-(15342)", "-(245)", "-(14)(25)X", "-(143)", "-(15)(24)", "-(235)", "-(154)", "(12354)", "-(14235)", "-1"}, {"(13)(24)X", "(25)(34)X", "(14)(23)X", "(12435)X", "(23)(45)X", "(14352)", "(153)X", "(123)X", "(12543)X", "(254)X", "(14532)X", "(354)X", "(14253)X", "(12)(34)X", "(14)(25)X", "(13542)X", "(234)X", "(235)X", "(14)(35)X", "(15432)X", "(13)(45)X", "-(13)(24)X", "-(25)(34)X","-(14)(23)X", "-(12435)X", "-(23)(45)X","-(14352)X", "-(153)X", "-(123)X", "-(12543)X", "-(254)X", "-(14532)X", "-(354)X", "-(14253)X", "-(12)(34)X","-(14)(25)X", "-(13542)X", "-(234)X", "-(235)X", "-(14)(35)X", "-(15432)", "-(13)(45)X", "(15243)X", "-(15)(34)X","-1X"}, {"(13)(24)X", "(13)(25)X", "(14352)X", "(153)X", "(12543)X", "(254)X", "(12)(34)X", "(13245)X", "(12)(35)X", "-(13)(24)X", "-(13)(25)X","-(14352)X", "-(153)X", "-(12543)X", "-(254)X", "-(12)(34)X", "-(13245)X", "-(12)(35)X", "(142)X", "-(354)X", "-1X"}, {"(13)(24)", "(13254)X", "(25)(34)", "(13)(45)", "(15342)", "(135)X", "(123)", "(13452)", "(254)X", "(14)(25)", "(13542)", "(143)X", "(15)(24)", "(12)(45)X", "(15243)X", "-(13)(24)X", "-(13254)", "-(25)(34)X", "-(13)(45)X", "-(15342)", "-(135)", "-(123)", "-(13452)", "-(254)", "-(14)(25)", "-(13542)", "-(143)", "-(15)(24)X", "-(12)(45)X","-(15243)X", "(14325)", "-(14253)", "-1"}, // begin copy 2 of 3, for the (+,-)a5 cables {"(123)", "(13)(24)", "(14523)", "(25)(34)", "(13)(25)", "(153)", "(14)(23)", "(14352)X", "(12543)X", "(254)", "(12435)X", "(14253)", "(12)(35)X", "(14532)", "(15)(34)", "(354)", "(152)", "(13542)", "(12)(45)", "(24)(35)", "(15432)", "-(123)X", "-(13)(24)X","-(14523)", "-(25)(34)X", "-(13)(25)X","-(153)X", "-(14)(23)X", "-(14352)", "-(12543)", "-(254)", "-(12435)", "-(14253)X", "-(12)(35)", "-(14532)", "-(15)(34)X", "-(354)X", "-(152)", "-(13542)X", "-(12)(45)", "-(24)(35)", "-(15432)", "-(134)", "(23)(45)X", "-1"}, {"(123)X", "(13)(24)X", "(14523)X", "(25)(34)X", "(12435)X", "(153)X", "(14)(23)X", "(13)(45)X", "(23)(45)X", "(254)X", "(14253)X", "(14)(25)X", "(13542)X", "(134)X", "(12)(45)X", "(235)X", "(15)(23)X", "(14235)X", "(15243)X", "(145)X", "(12543)X", "-(123)X", "-(13)(24)X","-(14523)X", "-(25)(34)X", "-(12435)X", "-(153)X", "-(14)(23)X", "-(13)(45)X","-(23)(45)X", "-(254)X", "-(14253)X", "-(14)(25)X", "-(13542)X", "-(134)X", "-(12)(45)", "-(235)X", "-(15)(23)X","-(14235)X", "-(15243)X", "-(145)X", "-(12543)X", "-(15)(24)X", "(14532)X", "-1X"}, {"(123)X", "(13)(24)X", "(14523)X", "(25)(34)X", "(15342)", "(14)(23)", "(13)(45)X", "(23)(45)", "(135)", "(254)", "(13524)", "(14)(25)X", "(13542)X", "(12)(45)", "(15)(24)X", "(235)X", "(15)(23)X", "(14235)X", "(15243)X", "(154)X", "(12543)", "-(123)X", "-(13)(24)X","-(14523)X", "-(25)(34)X", "-(15342)X", "-(14)(23)X", "-(13)(45)X", "-(23)(45)", "-(135)X", "-(254)X", "-(13524)X", "-(14)(25)X", "-(13542)X", "-(12)(45)X","-(15)(24)", "-(235)X", "-(15)(23)X","-(14235)X", "-(15243)", "-(154)X", "-(12543)X", "-(12354)", "(143)", "-1"}, {"(123)", "(13)(24)", "(14523)", "(13)(25)", "(14)(32)X", "(14352)", "(135)X", "(13452)X", "(15342)X", "(254)X", "(12)(35)X", "(15)(34)", "(354)", "(12)(34)X", "(13245)X", "(14)(25)X", "(234)X", "(12)(45)X", "(15)(23)", "(14235)", "(15243)X", "-(123)", "-(13)(24)", "-(14523)", "-(13)(25)X", "-(14)(32)X","-(14352)", "-(135)X", "-(13452)X", "-(15342)X", "-(254)", "-(12)(35)", "-(15)(34)", "-(354)X", "-(12)(34)X","-(13245)", "-(14)(25)X", "-(234)X", "-(12)(45)X", "-(15)(23)X", "-(14235)X", "-(15243)", "-(12354)", "(145)", "-1"}, {"(123)", "(13)(24)", "(13)(25)", "(14)(32)", "(14352)", "(23)(45)X", "(12543)", "(15342)X", "(245)", "(14)(25)", "(143)X", "(15)(24)", "(235)", "(154)", "-(123)", "-(13)(24)", "-(13)(25)", "-(14)(32)", "-(14352)", "-(23)(45)", "-(12543)", "-(15342)", "-(245)", "-(14)(25)X", "-(143)", "-(15)(24)", "-(235)", "-(154)", "-(12354)", "(14235)", "-1"}, {"(13)(24)", "(25)(34)", "(14)(23)X", "(12435)X", "(23)(45)", "(14352)", "(153)X", "(123)", "(12543)X", "(254)X", "(14532)X", "(354)", "(14253)X", "(12)(34)X", "(14)(25)X", "(13542)", "(234)X", "(235)", "(14)(35)X", "(15432)", "(13)(45)X", "-(13)(24)", "-(25)(34)X","-(14)(23)X", "-(12435)X", "-(23)(45)", "-(14352)", "-(153)X", "-(123)X", "-(12543)X", "-(254)", "-(14532)", "-(354)X", "-(14253)", "-(12)(34)X","-(14)(25)X", "-(13542)X", "-(234)X", "-(235)", "-(14)(35)X", "-(15432)", "-(13)(45)X", "-(15243)", "(15)(34)", "-1"}, {"(13)(24)X", "(13)(25)X", "(14352)X", "(153)X", "(12543)X", "(254)X", "(12)(34)X", "(13245)X", "(12)(35)X", "-(13)(24)X", "-(13)(25)X","-(14352)X", "-(153)X", "-(12543)X", "-(254)X", "-(12)(34)X", "-(13245)X", "-(12)(35)X", "-(142)X", "(354)X", "-1X"}, {"(13)(24)X", "(13254)X", "(25)(34)", "(13)(45)X", "(15342)", "(135)", "(123)", "(13452)", "(254)", "(14)(25)", "(13542)X", "(143)X", "(15)(24)X", "(12)(45)X", "(15243)X", "-(13)(24)", "-(13254)", "-(25)(34)X", "-(13)(45)", "-(15342)", "-(135)X", "-(123)", "-(13452)", "-(254)X", "-(14)(25)", "-(13542)", "-(143)", "-(15)(24)X", "-(12)(45)X","-(15243)", "-(14325)", "(14253)", "-1"}, { // begin copy 3 of 3, for the (-,-)a5 cables "(123)X", "(13)(24)X", "(14523)X", "(25)(34)X", "(13)(25)X", "(153)X", "(14)(23)X", "(14352)X", "(12543)X", "(254)X", "(12435)X", "(14253)X", "(12)(35)X", "(14532)X", "(15)(34)X", "(354)X", "(152)X", "(13542)X", "(12)(45)X", "(24)(35)X", "(15432)X", "-(123)X", "-(13)(24)X","-(14523)X", "-(25)(34)X", "-(13)(25)X","-(153)X", "-(14)(23)X", "-(14352)X", "-(12543)X", "-(254)X", "-(12435)X", "-(14253)X", "-(12)(35)X", "-(14532)", "-(15)(34)X", "-(354)X", "-(152)X", "-(13542)X", "-(12)(45)X", "-(24)(35)X","-(15432)", "(134)X", "(23)(45)X", "-1X"}, {"(123)", "(13)(24)", "(14523)X", "(25)(34)", "(12435)", "(153)", "(14)(23)", "(13)(45)", "(23)(45)", "(254)X", "(14253)X", "(14)(25)", "(13542)", "(134)", "(12)(45)", "(235)", "(15)(23)", "(14235)", "(15243)", "(145)X", "(12543)", "-(123)", "-(13)(24)X","-(14523)", "-(25)(34)X", "-(12435)X", "-(153)", "-(14)(23)", "-(13)(45)", "-(23)(45)", "-(254)", "-(14253)", "-(14)(25)", "-(13542)X", "-(134)X", "-(12)(45)X", "-(235)", "-(15)(23)", "-(14235)", "-(15243)X", "-(145)", "-(12543)", "(15)(24)", "(14532)", "-1"}, {"(123)X", "(13)(24)X", "(14523)X", "(25)(34)X", "(15342)X", "(14)(23)X", "(13)(45)X", "(23)(45)X", "(135)X", "(254)X", "(13524)X", "(14)(25)X", "(13542)X", "(12)(45)X", "(15)(24)X", "(235)X", "(15)(23)X", "(14235)X", "(15243)X", "(154)X", "(12543)X", "-(123)X", "-(13)(24)X","-(14523)X", "-(25)(34)X", "-(15342)", "-(14)(23)X", "-(13)(45)X", "-(23)(45)X","-(135)X", "-(254)X", "-(13524)", "-(14)(25)X", "-(13542)X", "-(12)(45)X","-(15)(24)X", "-(235)X", "-(15)(23)X","-(14235)X", "-(15243)X", "-(154)X", "-(12543)X", "(12354)X", "(143)X", "-1X"}, {"(123)X", "(13)(24)", "(14523)X", "(13)(25)", "(14)(32)X", "(14352)X", "(135)X", "(13452)X", "(15342)X", "(254)X", "(12)(35)X", "(15)(34)", "(354)X", "(12)(34)X", "(13245)X", "(14)(25)X", "(234)X", "(12)(45)X", "(15)(23)X", "(14235)X", "(15243)X", "-(123)X", "-(13)(24)X","-(14523)X", "-(13)(25)X", "-(14)(32)X","-(14352)X", "-(135)X", "-(13452)X", "-(15342)X", "-(254)X", "-(12)(35)X","-(15)(34)X", "-(354)X", "-(12)(34)X","-(13245)X", "-(14)(25)X", "-(234)X", "-(12)(45)X", "-(15)(23)X", "-(14235)", "-(15243)X", "(12354)X", "(145)X", "-1X"}, {"(123)X", "(13)(24)X", "(13)(25)X", "(14)(32)X", "(14352)X", "(23)(45)X", "(12543)X", "(15342)X", "(245)X", "(14)(25)X", "(143)X", "(15)(24)X", "(235)X", "(154)X", "-(123)X", "-(13)(24)X","-(13)(25)X", "-(14)(32)X", "-(14352)X", "-(23)(45)X", "-(12543)X", "-(15342)X", "-(245)X", "-(14)(25)X", "-(143)X", "-(15)(24)X", "-(235)X", "-(154)X", "(12354)X", "(14235)X", "-1X"}, {"(13)(24)", "(25)(34)X", "(14)(23)X", "(12435)X", "(23)(45)", "(14352)X", "(153)X", "(123)", "(12543)X", "(254)", "(14532)", "(354)", "(14253)", "(12)(34)X", "(14)(25)X", "(13542)", "(234)X", "(235)X", "(14)(35)X", "(15432)", "(13)(45)X", "-(13)(24)X", "-(25)(34)X","-(14)(23)X", "-(12435)", "-(23)(45)X","-(14352)", "-(153)X", "-(123)X", "-(12543)X", "-(254)X", "-(14532)", "-(354)", "-(14253)", "-(12)(34)X","-(14)(25)X", "-(13542)", "-(234)X", "-(235)", "-(14)(35)X", "-(15432)X", "-(13)(45)X", "(15243)", "(15)(34)", "-1"}, {"(13)(24)X", "(13)(25)X", "(14352)X", "(153)X", "(12543)X", "(254)X", "(12)(34)X", "(13245)X", "(12)(35)X", "-(13)(24)X", "-(13)(25)X","-(14352)", "-(153)X", "-(12543)X", "-(254)X", "-(12)(34)X", "-(13245)X", "-(12)(35)X", "(142)X", "(354)X", "-1X"}, {"(13)(24)", "(13254)X", "(25)(34)X", "(13)(45)", "(15342)", "(135)", "(123)X", "(13452)X", "(254)", "(14)(25)", "(13542)", "(143)X", "(15)(24)X", "(12)(45)X", "(15243)X", "-(13)(24)X", "-(13254)", "-(25)(34)X", "-(13)(45)X", "-(15342)", "-(135)X", "-(123)", "-(13452)", "-(254)", "-(14)(25)X", "-(13542)", "-(143)X", "-(15)(24)X", "-(12)(45)X","-(15243)", "(14325)", "(14253)", "-1"} } }; int[][][] strutnumb3rs = { { // a4 { 1, 3, 9}, { 1, 6,11} }, { // a4z2 { 1,12, 3,15, 7,23,22,19, 6}, { 13, 1,12, 3,15, 9, 4,22,21}, { 13, 1,12,15, 9, 4, 7,23}, { 13, 1,12, 3, 9,11,18, 7,16}, { 13,21, 1,12, 3,15, 9, 4} }, { // s4 { 23, 5, 1, 8,16, 3,11,19,10}, { 23,13, 5,15,16, 3,11, 7,10}, { 23,16, 1,15,17, 6,12,20, 2,11}, { 5, 1,16, 6,12,11} }, { // s4z2 {11,41,19,44,36,34,12, 6, 3,28,42,33,23, 4,15, 1, 5,47,22,25,24,46,35}, {11,41,36,10,19,29,32, 6, 3,30,33,23, 2, 8, 1,38,27,47,20,14,24}, {11,36,10,25,19,41,12,14,32, 3,28,42,33,23,15, 5,27,20,22,47,24,46,35}, {11,14,36,10,44,41,34,12,32, 3,26,42,23, 8,17,22,47,24,35}, {14,36,44,27,10,34,12,11,37, 6, 3, 2,28,33, 1,25,20,22,21,24,35}, {10,44,19,27,41,12,39,15,36, 3, 4,42,33,23,29,15, 1,38,14,24,47}, {36,10,44,19,27,12,11,32,18, 3,34,33, 2,17, 1,45,21,25,24,35} }, { // a5 { 1, 6,20,45,43,51, 9,28,41,40,26,16,33,48,56,30,53,32,23,25,48}, { 1, 6,20,45,26,21,22,40,36,38,32, 4,23,35,52,27,58,19,41,26,51}, { 1, 6,20,45,55, 9,21,22,34,40,24,38,32,23,57,35,52,27,58,49,41}, { 1, 6,20,43, 9,28,34,13,55,40,33,56,30, 3,17,38, 5,23,52,27,58}, { 1, 6,43, 9,28,22,41,55,15,38,11,57,35,49}, { 6,45, 9,26,22,28,51, 1,41,40,18,30,36, 3,38,32, 5,35,29,48,21}, { 6,43,28,51,41,40, 3,17,33}, { 6,39,45,21,55,34, 1,13,40,38,32,11,57,23,58} }, { // a5z2 copy 1 of 3 for the a5(-,+) { 1, 6, 20, 45, 43, 51, 9,28, 41, 40,26,16,33, 48, 56,30, 53,32,23,25, 48, 61,66, 80,105,103,111,69,88,101,100,86,76,93,108,116,90,113,92,83,85,108, 4, 82,60}, { 1, 6, 20, 45, 9,21,22, 40,36,38,32, 4,23,35, 52,27, 58,19, 41,26, 51, 61,66, 80,105,69,81,82,100,96,98,92,64,83,95,112,87,118,79,101,86,111, 57, 78,60}, { 1, 6,20, 45, 55, 9,21,22,34, 40,24,38,32,23, 57,35, 52,27, 58, 49, 41, 61,66,80,105,115,69,81,82,94,100,84,98,92,83,117,95,112,87,118,109,101, 31, 71,60}, { 1, 6,20, 43, 9,28,34,13, 55, 40,33, 56,30, 3,17,38, 5,23, 52,27, 58, 61,66,80,103,69,88,94,73,115,100,93,116,90,63,77,98,65,83,112,87,118, 31, 79,60}, { 1, 6, 43, 9,28,22, 41, 55,15,38,11, 57,35, 49, 61,66,103,69,88,82,101,115,75,98,71,117,95,109, 31, 87,60}, { 6, 45, 9,26,22,28, 51, 1, 41, 40,18,30,36, 3,38,32, 5,35,29, 48,21, 66,105,69,86,82,88,111,61,101,100,78,90,96,63,98,92,65,95,89,108,81, 58,116,60}, { 6, 43,28, 51, 41, 40, 3,17,33, 66,103,88,111,101,100,63,77,93, 10, 90,60}, { 6,39, 45,21, 55,34, 1,13, 40,38,32,11, 57,23, 58, 66,99,105,81,115,94,61,73,100,98,92,71,117,83,118, 37, 96,60}, // copy 2 of 3 for the a5(+,-) { 1, 6, 20, 45, 43, 51, 9,28, 41, 40,26,16,33, 48, 56,30, 53,32,23,25, 48, 61,66, 80,105,103,111,69,88,101,100,86,76,93,108,116,90,113,92,83,85,108, 64,22,60}, { 1, 6, 20, 45, 9,21,22, 40,36,38,32, 4,23,35, 52,27, 58,19, 41,26, 51, 61,66, 80,105,69,81,82,100,96,98,92,64,83,95,112,87,118,79,101,86,111, 117,18,60}, { 1, 6,20, 45, 55, 9,21,22,34, 40,24,38,32,23, 57,35, 52,27, 58, 49, 41, 61,66,80,105,115,69,81,82,94,100,84,98,92,83,117,95,112,87,118,109,101, 91, 11, 60}, { 1, 6,20, 43, 9,28,34,13, 55, 40,33, 56,30, 3,17,38, 5,23, 52,27, 58, 61,66,80,103,69,88,94,73,115,100,93,116,90,63,77,98,65,83,112,87,118, 91,19,60}, { 1, 6, 43, 9,28,22, 41, 55,15,38,11, 57,35, 49, 61,66,103,69,88,82,101,115,75,98,71,117,95,109, 91,27,60}, { 6, 45, 9,26,22,28, 51, 1, 41, 40,18,30,36, 3,38,32, 5,35,29, 48,21, 66,105,69,86,82,88,111,61,101,100,78,90,96,63,98,92,65,95,89,108,81, 118, 56,60}, { 6, 43,28, 51, 41, 40, 3,17,33, 66,103,88,111,101,100,63,77,93, 70, 30,60}, { 6,39, 45,21, 55,34, 1,13, 40,38,32,11, 57,23, 58, 66,99,105,81,115,94,61,73,100,98,92,71,117,83,118, 97, 36,60}, // copy 3 of 3 for the a5(-,-) { 1, 6, 20, 45, 43, 51, 9,28, 41, 40,26,16,33, 48, 56,30, 53,32,23,25, 48, 61,66, 80,105,103,111,69,88,101,100,86,76,93,108,116,90,113,92,83,85,108, 4, 22,60}, { 1, 6, 20, 45, 9,21,22, 40,36,38,32, 4,23,35, 52,27, 58,19, 41,26, 51, 61,66, 80,105,69,81,82,100,96,98,92,64,83,95,112,87,118,79,101,86,111, 57,18,60}, { 1, 6,20, 45, 55, 9,21,22,34, 40,24,38,32,23, 57,35, 52,27, 58, 49, 41, 61,66,80,105,115,69,81,82,94,100,84,98,92,83,117,95,112,87,118,109,101, 31,11,60}, { 1, 6,20, 43, 9,28,34,13, 55, 40,33, 56,30, 3,17,38, 5,23, 52,27, 58, 61,66,80,103,69,88,94,73,115,100,93,116,90,63,77,98,65,83,112,87,118, 31,19,60}, { 1, 6, 43, 9,28,22, 41, 55,15,38,11, 57,35, 49, 61,66,103,69,88,82,101,115,75,98,71,117,95,109, 31,27,60}, { 6, 45, 9,26,22,28, 51, 1, 41, 40,18,30,36, 3,38,32, 5,35,29, 48,21, 66,105,69,86,82,88,111,61,101,100,78,90,96,63,98,92,65,95,89,108,81, 58,56,60}, { 6, 43,28, 51, 41, 40, 3,17,33, 66,103,88,111,101,100,63,77,93, 10,30,60}, { 6,39, 45,21, 55,34, 1,13, 40,38,32,11, 57,23, 58, 66,99,105,81,115,94,61,73,100,98,92,71,117,83,118, 37,36,60} } }; int many = grpname.length; // number of groups implemented int grp = 0; // which group we are using RenderPanel rp; // to rotate the tensegrity Geometry[] Gp, gc1, gc2, gs1; // vertex, cable, cable, strut Material join, cab1, cab2, str1; // vertex, cable, cable, strut double fov; // camera field of view graf detplotter; int nsaved; // number of detplot lines saved double[][] lines; TextArea txt; bpanel bpan; // holds group, cable, strut choices apanel apan; // holds text area, thicker slider double thk = 0.65; // thickness coefficient double omeg1, omeg_1; // cable stress ratio, strut stress int c1,c2,s1; // group element numbers of cables and strut int c; // cable class number as listed in the bpanel int winr, S, rk; // size and rank of winr boolean wasMouseRelease = true; // then print lengths in rpset() Jama.Matrix Jp1, // first vertex JOM; // stress matrix Jama.Matrix[][][] Jom, // loc stress mat index by group, rep, element number Jg, // group elements " Jmx; // generators indexed by group, rep, generator number Color acolor = new Color(220,220,200); String tracer; // keep coords in povray code NumberFormat nf; // used when we output a povray file Dialog di; // for povray code TextArea ditxt; Button dibut; public void init() { makematrices(); setLayout(new BorderLayout(5,5)); setBackground(Color.darkGray); rp = new RenderPanel(); rp.setSize(getSize().width*2/3,getSize().height*5/6); rp.init(); rp.setFOV(fov=1.0); add("Center",rp); bpan = new bpanel(this); add("North",bpan); rpsetup(); rp.start(); apan = new apanel(this); apan.setSize(getSize().width,getSize().height*1/6); add("South",apan); detplotter = new graf(this); detplotter.setSize(getSize().width*1/3,getSize().height*5/6); lines = new double[11][1+detplotter.pts]; // 11 = 1+max#reps add("East",detplotter); nf = new DecimalFormat("#0.000"); di = new Dialog(new Frame(),"povray code"); di.setModal(false); di.setSize(600,750); di.setResizable(true); ditxt = new TextArea("",60,80,TextArea.SCROLLBARS_VERTICAL_ONLY); ditxt.setBackground(Color.white); di.setLayout(new BorderLayout()); di.add("Center",ditxt); dibut = new Button("close"); dibut.setBackground(Color.yellow); dibut.addActionListener(apan); di.add("South",dibut); } public void start() { } public void stop() { } void makematrices() { Jom = new Jama.Matrix[many][][]; Jg = new Jama.Matrix[many][][]; Jmx = new Jama.Matrix[many][][]; for( int G = 0; G < many; ++G) { Jom[G] = new Jama.Matrix[reps[G]][order[G]]; Jg[G] = new Jama.Matrix[reps[G]][order[G]]; Jmx[G] = new Jama.Matrix[reps[G]][gens[G]]; // make generators; turn the mx arrays into Jama matrices for( int gn = 0; gn < gens[G]; ++gn) { for( int rp = 0; rp < reps[G]; ++rp) { Jmx[G][rp][gn] = new Jama.Matrix(mx[G][rp][gn]); } } // make group elements; use the products of generators to powers for( int j = 0; j < order[G]; ++j) { for( int rp = 0; rp < reps[G]; ++rp) { Jg[G][rp][j] = pow(Jmx[G][rp][0],to[G][j][0]); for( int ngen = 1; ngen < gens[G]; ++ngen) { Jg[G][rp][j] = Jg[G][rp][j].times(pow(Jmx[G][rp][ngen],to[G][j][ngen])); } } } // make local stress matrices; I-g or 2I-g-g^{-1} for (int rep = 0; rep < reps[G]; ++rep) { int sz = deg[G][rep]; Jama.Matrix eye = Jama.Matrix.identity(sz,sz); for( int j = 0; j < order[G]; ++j) { if( isinvolution[G][j] == false) { Jama.Matrix trans = Jg[G][rep][j].transpose(); // inverse of orthog Jom[G][rep][j] = eye.times(2).minus(Jg[G][rep][j]).minus(trans); } else // it is involution { Jom[G][rep][j] = eye.minus(Jg[G][rep][j]); } } } } } void rpsetup() { join = new Material(); join.setColor(.8,.8,.8,.2,.2,.2,.4); cab1 = new Material(); cab2 = new Material(); str1 = new Material(); cab1.setColor(.2,.2,.9,.2,.2,.2,.4); cab2.setColor(.8,.2,.2,.2,.2,.2,.4); str1.setColor(.7,.6,.3,.2,.2,.2,.4); // wood dowels at first rp.setBgColor( 0,.4,.4); rp.addLight( 1, 1,1, 1, 1,1); rp.addLight(-1,-1,0,.6,.6,1); rp.addLight(-2,-3,1, 1, 1,1); Gp = new Geometry[order[grp]]; for( int k = 0; k < order[grp]; ++k) { Gp[k] = rp.world.add().ball(3); Gp[k].setMaterial(join); } gc1 = new Geometry[order[grp]]; gc2 = new Geometry[order[grp]]; gs1 = new Geometry[order[grp]]; } void cleanup() { tracer = "#include \"colors.inc\"\n" +"#include \"shapes.inc\"\n" +"#include \"textures.inc\"\n" +"#declare c1txr = Ruby_Glass \n" +"#declare c2txr = texture{NBglass pigment{Sapphire_Agate}} \n" +"#declare s1txr = Tinny_Brass \n" +"#declare vertxr = Soft_Silver \n" +"#declare c1rad = .03;\n" +"#declare c2rad = .03;\n" +"#declare s1rad = .03;\n" +"#declare vrad = .05;\n" +"light_source { <-10,8,-3> color White }\n" +"light_source { <5, 2,-4> color White }\n" +"light_source { <0, 2,-5> color White }\n" +"plane { y,-1 pigment { colour White }}\n" +"camera {location<1,.1,-3> look_at<0,-.5,.4>}\n"; for( int i = 0; i < gc1.length; ++i) { rp.world.delete(gc1[i]); rp.world.delete(gc2[i]); rp.world.delete(gs1[i]); } for( int k = 0; k < Gp.length; ++k) { // rp traces vertex path as you slide, if not: rp.world.delete(Gp[k]); } Gp = null; Gp = new Geometry[order[grp]]; for( int k = 0; k < order[grp]; ++k) { Gp[k] = rp.world.add().ball(3); Gp[k].setMaterial(join); } gc1 = null; gc1 = new Geometry[order[grp]]; gc2 = null; gc2 = new Geometry[order[grp]]; gs1 = null; gs1 = new Geometry[order[grp]]; } void rpset() { // decide winr, omeg1, omeg_1, in the detplotter before here cleanup(); S = deg[grp][winr]; if( S > 3) { apan.txt.append(" Winner has degree more than 3 \n"); return; } { // uncomment these if you want to display the // parameters needed for tiny.java /* System.out.println("omeg1: "+Double.toString(omeg1)); System.out.println("omeg_1: "+Double.toString(omeg_1)); System.out.println("c1: "+Integer.toString(c1)); System.out.println("c2: "+Integer.toString(c2)); System.out.println("s1: "+Integer.toString(s1)); System.out.println("grp: "+Integer.toString(grp)); System.out.println("winr: "+Integer.toString(winr)); */ JOM = Jom[grp][winr][c1].times(omeg1).plus( Jom[grp][winr][c2].times(1-omeg1)).plus( Jom[grp][winr][s1].times(omeg_1)); Jp1 = null; SingularValueDecomposition dJOM = JOM.svd(); Jp1 = dJOM.getV().getMatrix(0,S-1,rk,rk); // the vertex is in the kernel of omega: Use // the first right singular kernel vector listed } if( Jp1.get(0,0) < 0) { Jp1 = Jp1.times(-1); // looks smoother } Jp1 = Jp1.times(1/(Jp1.norm2())); if( wasMouseRelease) { apan.txt.append(" #" +Integer.toString(winr) +", rank "+Integer.toString(rk)+":: "); // print member lengths only if user released mouse } for( int k = 0; k < order[grp]; ++k) { // to draw the vertices Gp every time in case user is // dragging in the detplotter rp.push(); Jama.Matrix Jgkp1 = Jg[grp][winr][k].times(Jp1); if( S == 2) { rp.translate(4*Jgkp1.get(0,0),4*Jgkp1.get(1,0),0); } else if( S == 3) { rp.translate(4*Jgkp1.get(0,0),4*Jgkp1.get(1,0),4*Jgkp1.get(2,0)); } else if( S == 1) { rp.translate(4*Jgkp1.get(0,0),0,0); } rp.scale(thk*0.15,thk*0.15,thk*0.15); // size of vertices rp.transform(Gp[k]); rp.pop(); } for( int i = 0; i < order[grp]; ++i) { // make a path x->y->z // from gi*p1 to gi*c1*p1 for each gi Jama.Matrix Jgip1 = Jg[grp][winr][i].times(Jp1), Jgic1p1 = Jg[grp][winr][i].times(Jg[grp][winr][c1]).times(Jp1), Jgic2p1 = Jg[grp][winr][i].times(Jg[grp][winr][c2]).times(Jp1), Jgis1p1 = Jg[grp][winr][i].times(Jg[grp][winr][s1]).times(Jp1); if(( i == 0)&&( wasMouseRelease)) // print lengths { double st1 = Jgip1.minus(Jgis1p1).norm2(), c1bys1 = Jgip1.minus(Jgic1p1).norm2()/st1, c2bys1 = Jgip1.minus(Jgic2p1).norm2()/st1; apan.txt.append(" c1: "+nf.format(c1bys1) +" c2: "+nf.format(c2bys1) +" s1: 1.000 \n"); wasMouseRelease = false; } double[] x = new double[3], y = new double[3], z = new double[3]; // Jgj have the rep size, xyz are of size 3 x[0] = Jgip1.get(0,0); z[0] = Jgic1p1.get(0,0); if( S == 1) { x[1] = z[1] = 0; x[2] = z[2] = 0;} else { x[1] = Jgip1.get(1,0); z[1] = Jgic1p1.get(1,0); } if( S == 2) { x[2] = z[2] = 0; } else if( S == 3) { x[2] = Jgip1.get(2,0); z[2] = Jgic1p1.get(2,0); tracer += "cylinder{<" +nf.format(x[0])+"," +nf.format(x[1])+"," +nf.format(x[2]) +">,<" +nf.format(z[0])+"," +nf.format(z[1])+"," +nf.format(z[2]) +">,c1rad texture{c1txr}}\n"; } y[0] = .5*(x[0]+z[0]); y[1] = .5*(x[1]+z[1]); y[2] = .5*(x[2]+z[2]); // The last three entries in a path seem // to be undocumented in the render package. // But the .2 here helps appearance: double[][] pathc1 = {{4*x[0],4*x[1],4*x[2],1,.20,0}, {4*y[0],4*y[1],4*y[2],1,.20,0}, {4*z[0],4*z[1],4*z[2],1,.20,0}}; z[0] = Jgic2p1.get(0,0); if( S == 1) { z[1] = 0;} else { z[1] = Jgic2p1.get(1,0); } if( S == 2) { z[2] = 0;} else if( S == 3) { z[2] = Jgic2p1.get(2,0); tracer += "cylinder{<" +nf.format(x[0])+"," +nf.format(x[1])+"," +nf.format(x[2]) +">,<" +nf.format(z[0])+"," +nf.format(z[1])+"," +nf.format(z[2]) +">,c2rad texture{c2txr}}\n"; } y[0] = .5*(x[0]+z[0]); y[1] = .5*(x[1]+z[1]); y[2] = .5*(x[2]+z[2]); double[][] pathc2 = {{4*x[0],4*x[1],4*x[2],1,.20,0}, {4*y[0],4*y[1],4*y[2],1,.20,0}, {4*z[0],4*z[1],4*z[2],1,.20,0}}; z[0] = Jgis1p1.get(0,0); if( S == 1) { z[1] = 0;} else { z[1] = Jgis1p1.get(1,0); } if( S == 2){ z[2] = 0;} else if( S ==3) { z[2] = Jgis1p1.get(2,0); tracer += "cylinder{<" +nf.format(x[0])+"," +nf.format(x[1])+"," +nf.format(x[2]) +">,<" +nf.format(z[0])+"," +nf.format(z[1])+"," +nf.format(z[2]) +">,s1rad texture{s1txr}}\n" +"sphere{<" +nf.format(x[0])+"," +nf.format(x[1])+"," +nf.format(x[2]) +">, vrad texture{vertxr}}\n"; } y[0] = .5*(x[0]+z[0]); y[1] = .5*(x[1]+z[1]); y[2] = .5*(x[2]+z[2]); double[][] paths1 = {{4*x[0],4*x[1],4*x[2],1,.2,0}, {4*y[0],4*y[1],4*y[2],1,.2,0}, {4*z[0],4*z[1],4*z[2],1,.2,0}}; gc1[i] = rp.world.add().wire(3,pathc1,thk*0.07); gc1[i].setMaterial(cab1); gc2[i] = rp.world.add().wire(3,pathc2,thk*0.07); gc2[i].setMaterial(cab2); gs1[i] = rp.world.add().wire(3,paths1,thk*0.11); gs1[i].setMaterial(str1); } rp.damage(); } int getrank(int rep, double om1, double y) { return Jom[grp][rep][c1].times(om1).plus( Jom[grp][rep][c2].times(1-om1) ).plus( Jom[grp][rep][s1].times(y) ).rank(); } double getdet(int rep, double om1, double y) { Jama.Matrix A = Jom[grp][rep][c1].times(om1).plus( Jom[grp][rep][c2].times(1-om1) ).plus( Jom[grp][rep][s1].times(y) ); if( cx[grp][rep]) { return A.get(0,0); } else { return A.det(); } } void debug(double d) { System.out.println(Double.toString(d)); } void debug(int d) { System.out.println(Integer.toString(d)); } void debug(String s) { System.out.println(s); } void debug(int rep, double om1, double y) { Jama.Matrix m = Jom[grp][rep][c1].times(om1).plus( Jom[grp][rep][c2].times(1-om1) ).plus( Jom[grp][rep][s1].times(y) ); debug("rep: "); debug(rep); m.print(10,3); m.eig().getD().print(10,3); } void getlines() { int pts = detplotter.pts; nsaved = 0; for( int rep = 2; rep < reps[grp]; ++rep) { boolean omit = false, found = false; for( int x = 0; x < pts; ++x) { double dy = .000301, y = .5*dy, deter = getdet(rep,(.5+x)/pts,y), dtest1 = getdet(rep,(.5+x)/pts,y-dy), dtest2 = getdet(rep,(.5+x)/pts,y-17*dy); boolean changes = false; if( Math.abs(dtest1-dtest2) > .00001) { changes = true; } else { // here check whether s1 in kernel of rep // because we don't know any reason why the det // would fail to change unless s1 is in the kernel if( Jom[grp][rep][s1].norm1() > .0001) { // never get here apan.txt.append(" no change and not in ker, why? \n"); } omit = true; // if decreasing y does not affect deter, then there is no root // so omit drawing nonexistent curve for that rep. break; // out of the for x loop } // now changes is true, and we look for evidence of a root while( (deter > .00001)&&(y > -5)) { y -= dy; deter = getdet(rep,(.5+x)/pts,y); } // now we are below threshold .00001 or at -5; in case the latter: if( y < -4.95) { // does the user want to see this message? // apan.txt.append(" root not found by -10 \n"); omit = true; } // we are below threshold, and think there is a root, possibly double. // a quick test works in most cases: see whether a lower y changes // the sign of determinant. If so record approximate root. If not // check for sign change in the slope suggesting double root // try 180 times for( int k = 0; k < 180; ++k) { dtest1 = getdet(rep,(.5+x)/pts,y-dy); if( dtest1 <= 0) { found = true; lines[nsaved][x] = y; // imperfect first 0 of det, for visual only break; // out of the for } else { // think this never happens dtest2 = getdet(rep,(.5+x)/pts,y-2*dy); if( (deter > dtest1)&&(dtest2 > dtest1)) { found = true; lines[nsaved][x] = y; break; // out of the for } } y -= dy; deter = getdet(rep,(.5+x)/pts,y); } if( found == false) { // does the user want to see this message? // apan.txt.append(" not found\n"); omit = true; break; // out of the x loop } } // end of for x loop if( omit) { continue; // to the next rep } else { lines[nsaved][pts] = rep; // store the rep number there at the end nsaved += 1; } } // end of for rep loop detplotter.draw(); } Jama.Matrix pow(Jama.Matrix A, int p) { if(p == 0) { return Jama.Matrix.identity(A.getRowDimension(),A.getRowDimension());} if(p == 1){ return A;} Jama.Matrix A2 = A.times(A); if(p == 2){ return A2;} Jama.Matrix A3 = A.times(A2); if(p == 3){ return A3;} Jama.Matrix A4 = A2.times(A2); if(p == 4){ return A4;} if(p == 5){ return A.times(A4);} if(p == 6){ return A2.times(A4);} if(p == 7){ return A3.times(A4);} else{ return A4.times(A4);} // never get here } boolean find0(double om1) { double y1 = .002, y2 = .005; double mindet = 1.0; int nreps = reps[grp]; double[][] detry = new double[nreps][2]; for( int r = 2; r < nreps; ++r) { detry[r][0] = getdet(r,om1,y1); mindet = Math.min( mindet, detry[r][0]); detry[r][1] = getdet(r,om1,y2); } // subtract from y1 until one of these dets is negative // then bisect to find 0 // bisection is ok: think there are no winners with double roots. while( mindet > 0) { y1 -= .001901; // errors occur at .00201 in a5z2 for( int r = 2; r < nreps; ++r) { detry[r][0] = getdet(r,om1,y1); mindet = Math.min( mindet, detry[r][0]); } } for( int r = nreps-1; r > 1; --r) { if( detry[r][0]*detry[r][1] <= 0) { // finds highest numbered rep if two are 0 since we count down. double y = bis(r,om1,y1,y2); // If here, rep r has 0 at y, and no rep has 0 at y2 or higher. // But it is possible that some rep numbered < r has a zero at some // number between y and y2, which was missed in the countdown. // Check it: double checky = -20.0; int checkr = -20; for( int rr = r-1; rr > 1; --rr) { if( getdet(rr,om1,y)*getdet(rr,om1,y2) <= 0.0) { checky = bis(rr,om1,y,y2); checkr = rr; apan.txt.append(" rep " +Integer.toString(rr) +" is barely distiguishable from rep " +Integer.toString(r) +"\n" ); } } if( checky > y) { y = checky; r = checkr; } // set winner here rk = getrank(r,om1,y); omeg1 = om1; omeg_1 = y; winr = r; return true; } } return false; } double bis(int rep, double om1, double y1, double y2) { // bisection, y1 < y2 double y = (y1+y2)/2; int sz = deg[grp][rep]; while( getrank(rep,om1,y) == sz ) //Jama must agree singular { if( getdet(rep,om1,y)*getdet(rep,om1,y2) <= +0.0) { y1 = y;} else { y2 = y;} y = (y1+y2)/2; } return y; } } // end public class ap class graf extends Canvas implements MouseListener, MouseMotionListener { ap d; double om1; int grayline = (30+210)/2; int pts = 18; public graf(ap d) { super(); this.d = d; addMouseListener(this); addMouseMotionListener(this); setVisible(true); setSize(d.getSize().width/3,360); setBackground(Color.white); } public void draw() { // run x from 31 to 210, y <= 0 is 100 down to about 150 int xra[] = {30,40,50,60, 70,80,90,100, 110,120,130,140, 150,160,170,180, 190,200}; // array of x values for pts = 18 Graphics gg = getGraphics(); gg.clearRect(0,0,getSize().width,getSize().height); gg.drawLine(30,10,30,250); // vert gg.drawLine(210,10,210,250); // vert gg.drawLine(25,20,215,20); // axis gg.drawString("0",17,20); // label axis for( int arep = 0; arep < d.nsaved; ++arep) { int[] ilines = new int[pts]; for( int x = 0; x < pts; ++x) { ilines[x] = 20-(int)(173*d.lines[arep][x]); } int rep = (int)d.lines[arep][pts]; // getlines() saved rep number in last slot String faith = "faithful"; if( d.is3dfaithful[d.grp][rep] == false) { faith = " "; gg.setColor(new Color( 25*rep,250-30*(rep-2),0)); } else { gg.setColor(Color.black); } gg.drawString( " rep " + Integer.toString(rep) + " deg " +Integer.toString(d.deg[d.grp][rep]) + " " + faith, 3,260+18*rep ); for( int i = 0; i < pts-1; ++i) { // drawLine(a,b,c,d) runs from what you would normally call // point (a,-b) to point (c, -d), with origin at upper left // So to plot y = f(x) normally with axis shown at (..,100) // and f scaled by say 30 pixels, you put points at (x,100-30*f(x)) gg.drawLine(5+xra[i], ilines[i], 5+xra[i+1], ilines[i+1]); } } } public void mouseClicked(MouseEvent ev) { mouseDragged(ev); } public void mouseReleased(MouseEvent ev) { d.wasMouseRelease = true; } public void mousePressed(MouseEvent ev) { //mouseDragged(ev); } public void mouseEntered(MouseEvent ev){} public void mouseExited(MouseEvent ev){} public void mouseMoved(MouseEvent ev) { d.wasMouseRelease = false; } public void mouseDragged(MouseEvent ev) { draw(); // show user the determinants Graphics g = getGraphics(); int clickx = ev.getX(); if( clickx < 31) {return;} if( clickx > 209) {return;} int clicky = ev.getY(); double om1tmp = (clickx-30.0)/180.0, om_1tmp = (20.0-clicky)/173.0; // cf 20-173y in detplot for( int rep = 2; rep < d.reps[d.grp]; ++rep) { g.clearRect(145,250+18*rep,280,13); g.drawString(" det " +d.nf.format( d.getdet(rep,om1tmp,om_1tmp)),150,260+18*rep); } g.setColor(Color.white); g.drawLine(grayline,10,grayline,220); // draw vertical line and print to show omeg1 int click = ev.getX(); if( click < 31) return; if( click > 209) return; grayline = click; g.setColor(Color.gray); g.drawLine(grayline,10,grayline,220); om1 = (clickx-30.0)/180.0; g.clearRect(30,250,140,30); if( d.find0(om1) == false) { g.drawString(" winner not found", 30, 230); } else { // finally you can draw a tensegrity d.rpset(); } } } // end class graf class apanel extends Panel implements ActionListener, ItemListener { ap d; TextArea txt; Button zoomin, zoomout, thinner, thicker, tracecode; Choice col; public apanel(ap d) { super(); this.d = d; setLayout(new BorderLayout(5,5)); String info = new String( "Symmetric Tensegrities 6/2008 based on the forthcoming\n" + "book 'Frameworks, Tensegrities, and Symmetries', by R.Connelly\n" + "and S.D.Guest. \n" + " Choose a group, a cable class, then a strut, then click in\n" + "the determinant plot to select a cable stress ratio. \n"); txt = new TextArea(info,6,50,TextArea.SCROLLBARS_VERTICAL_ONLY); txt.setBackground(d.acolor); add("East",txt); Panel p = new Panel(new GridLayout(5,4)); zoomin = new Button("zoom in"); zoomin.setBackground(d.acolor); zoomin.addActionListener(this); zoomout = new Button("zoom out"); zoomout.setBackground(d.acolor); zoomout.addActionListener(this); thinner = new Button("thinner"); thinner.setBackground(d.acolor); thinner.addActionListener(this); thicker= new Button("thicker"); thicker.setBackground(d.acolor); thicker.addActionListener(this); p.add(new Label(" ")); p.add(new Label(" ")); p.add(new Label(" ")); p.add(new Label(" ")); p.add(zoomin); p.add(new Label(" ")); p.add(thinner); p.add(new Label(" ")); p.add(zoomout); p.add(new Label(" ")); p.add(thicker); p.add(new Label(" ")); p.add(new Label(" ")); p.add(new Label(" ")); p.add(new Label(" ")); p.add(new Label(" ")); tracecode = new Button("tracecode"); tracecode.setBackground(new Color(140,140,120)); tracecode.addActionListener(this); col = new Choice(); col.addItemListener(this); col.setBackground(new Color(140,140,120)); col.removeAll(); col.addItem("colors"); // as a title, ignore selection col.addItem("blue/red/green"); col.addItem("wood dowels"); col.addItem("contrast"); p.add(tracecode); p.add(new Label(" ")); p.add(col); p.add(new Label(" ")); add("West",p); add("Center",new Panel()); } public void actionPerformed(ActionEvent e) { if(((String)e.getActionCommand()).equals("zoom in")) { d.rp.setFOV(d.fov = Math.max(.2,d.fov-.2)); d.rp.damage(); } else if(((String)e.getActionCommand()).equals("zoom out")) { d.rp.setFOV(d.fov = Math.min(2.2,d.fov+.2)); d.rp.damage(); } else if(((String)e.getActionCommand()).equals("thinner")) { d.thk *= .625; d.rpset(); } else if(((String)e.getActionCommand()).equals("thicker")) { if( d.thk < 2.0) { d.thk *= 1.6; d.rpset(); } } else if(((String)e.getActionCommand()).equals("tracecode")) { d.ditxt.setText(d.tracer); d.di.setVisible(true); } else if(((String)e.getActionCommand()).equals("close")) { d.di.setVisible(false); } } void debug(double d) { txt.append(Double.toString(d)); } void debug(int j) { txt.append(Integer.toString(j)); } void debug(String s) { txt.append(s); } public void itemStateChanged( ItemEvent e) { if( e.getSource() == col) { int i = col.getSelectedIndex(); if( i == 0) { // ignore the title space } else if( i == 1) // red/blue/green { d.cab1.setColor(.2,.2,.9,.2,.2,.2,.4); // blue d.cab2.setColor(.8,.2,.2,.2,.2,.2,.4); // red d.str1.setColor(.0,.7,.3,.2,.2,.2,.4); // green d.rp.setBgColor(1,1,1); // white d.rp.damage(); } else if( i == 2) // wood dowels { d.cab1.setColor(.2,.2,.9,.2,.2,.2,.4); d.cab2.setColor(.8,.2,.2,.2,.2,.2,.4); d.str1.setColor(.7,.6,.3,.2,.2,.2,.4); // wood d.rp.setBgColor( 0,.4,.4); d.rp.damage(); } else if( i == 3) // contrast { d.cab1.setColor(.6,.3, 0,.2,.2,.2,.4); d.cab2.setColor(.7,.1, 0,.2,.2,.2,.4); d.str1.setColor(.2, 0,.3,.2,.2,.2,.5); d.rp.setBgColor(.1,.1,.1); d.rp.damage(); } } } } // end class apanel class bpanel extends Panel implements ItemListener { ap d; Choice grplis, cablis, strlis; public bpanel(ap d) { super(); this.d = d; setLayout(new GridLayout(1,7)); setBackground(d.acolor); grplis = new Choice(); for( int k = 0; k < d.grpname.length; ++k) { grplis.addItem(d.grpname[k]); } grplis.select(0); grplis.addItemListener(this); add(new Label("group:",Label.RIGHT)); add(grplis); cablis = new Choice(); cablis.addItemListener(this); add(new Label("cables:",Label.RIGHT)); add(cablis); listcabchoices(); strlis = new Choice(); strlis.addItemListener(this); add(new Label("struts:",Label.RIGHT)); add(strlis); } void listcabchoices() { cablis.removeAll(); for( int k = 0; k < d.cables[d.grp].length; ++k) { cablis.addItem(d.cables[d.grp][k]); } } void liststrchoices() { strlis.removeAll(); for( int k = 0; k < d.struts[d.grp][d.c].length; ++k) { strlis.addItem(d.struts[d.grp][d.c][k]); } } public void itemStateChanged( ItemEvent e) { d.omeg1 = .35; if( e.getSource() == grplis) { d.grp = grplis.getSelectedIndex(); if( d.grp == -1) { d.grp = 0;} d.c = 0; d.c1 = d.cablnumb3rs[d.grp][d.c][0]; d.c2 = d.cablnumb3rs[d.grp][d.c][1]; d.s1 = d.strutnumb3rs[d.grp][d.c][0]; listcabchoices(); d.rp.damage(); /* if(( d.grp == 0)||( d.grp == 1)) { d.apan.txt.append("Some unfaithful reps are winners for A4 and A4Z2\n"); } */ return; } else if( e.getSource() == cablis) { d.c = cablis.getSelectedIndex(); if( d.c == -1) { d.c = 0;} d.grp = grplis.getSelectedIndex(); if( d.grp == -1) { d.grp = 0;} d.c1 = d.cablnumb3rs[d.grp][d.c][0]; d.c2 = d.cablnumb3rs[d.grp][d.c][1]; // safety: d.s1 = d.strutnumb3rs[d.grp][d.c][0]; liststrchoices(); d.rp.damage(); return; } else if( e.getSource() == strlis) { int s = strlis.getSelectedIndex(); if( s == -1) { s = 0;} d.c = cablis.getSelectedIndex(); if( d.c == -1) { d.c = 0;} d.grp = grplis.getSelectedIndex(); if( d.grp == -1) { d.grp = 0;} d.c1 = d.cablnumb3rs[d.grp][d.c][0]; d.c2 = d.cablnumb3rs[d.grp][d.c][1]; d.s1 = d.strutnumb3rs[d.grp][d.c][s]; d.apan.txt.repaint(); d.getlines(); d.rp.damage(); } } } // end class bpanel // end ap.java