%t=12 
y=[                     0                         0    1.000000000000000e+000
    9.992971869233277e-001                         0   -3.748509313212130e-002
    7.404591392588596e-001   -5.010356396924330e-001    4.479771767021430e-001
   -9.250054049594613e-001    5.900819028986845e-002   -3.753438880207028e-001
    8.786172883486478e-001    4.709962688009436e-001    7.870308374173407e-002
    8.442899507018296e-002    6.805527997676092e-001    7.278184055929801e-001
    4.678901894334894e-001   -7.023488204262551e-001    5.364558743063043e-001
    5.315056514225373e-001   -4.796935877539654e-001    6.981373821631620e-001
   -7.782314532354326e-001   -4.798785583797314e-001   -4.050584826941134e-001
   -1.227273279393244e-001   -9.550295866630891e-001   -2.699194168173211e-001
   -4.510525385800453e-001    3.983979746846622e-001   -7.986430123701428e-001
   -7.077557803290577e-001   -3.138996199811159e-001   -6.328892351640353e-001
    4.796293804673051e-001   -3.760603261918042e-001   -7.928015441818103e-001
   -7.096400564062922e-001   -4.410320865809079e-001    5.494558116443622e-001
   -8.420317674507076e-002    4.877246056995284e-001    8.689272317180984e-001
    4.983289001864231e-001    6.658228912187111e-001   -5.552910811170536e-001
    7.642548240069239e-002   -8.869313617413177e-001   -4.555347464239291e-001
   -1.525829933967466e-001    7.143473039195929e-002   -9.857055896259879e-001
    1.819442088738205e-001   -8.329633453759321e-001    5.225594417072716e-001
    3.404914245996482e-001   -8.338024435619388e-001   -4.345561815050406e-001
   -5.383408458238247e-001    5.875123192527391e-001    6.041675334242620e-001
   -6.173435675147073e-001   -7.042744376791212e-001   -3.505487641968970e-001
    5.950077623730027e-001   -8.015125681807318e-001    5.952617713409872e-002
    1.077303809830255e-001   -7.295730740396635e-001   -6.753645642536835e-001
    8.051790884813809e-001   -5.659328324196046e-001    1.772192559001880e-001
    2.004964241817608e-001   -9.583109861765301e-001   -2.035712103016877e-001
   -2.698799628199460e-002   -5.345713480032464e-001   -8.446923238379021e-001
   -6.595155581743091e-001    4.361144661252729e-001   -6.122445597653750e-001
    2.363408336330327e-001    8.283169416170869e-001   -5.079705253139778e-001
   -5.717591571173852e-001   -8.165945766982951e-001   -7.915025937638842e-002
   -9.907069513521338e-001   -6.106908329436367e-002   -1.215331379013437e-001
   -9.199062009544622e-001   -4.511389773676618e-002    3.895347451467265e-001
   -2.740811102102432e-002   -2.168759511012604e-001   -9.758143354574080e-001
    1.479793830713998e-001   -3.359630218593674e-002   -9.884196429984782e-001
   -2.751003533011470e-001   -9.592108446235445e-001   -6.507189232049881e-002
   -4.448983409634452e-001   -8.802627474669436e-001    1.649332035398635e-001
   -3.325271131041102e-001   -1.194000695460512e-001   -9.355048596576313e-001
    9.488085761265364e-001    2.813336240635931e-001   -1.435746420506752e-001
    2.511486067806808e-001    8.134480743361284e-001    5.246204415298430e-001
    9.393127121397178e-001   -3.225083964981899e-001    1.169613739697595e-001
    8.412832722248814e-001    5.042397511182355e-001   -1.948967143561323e-001
    2.268666268241441e-001    4.956667864688391e-001    8.383590939597952e-001
   -3.980190397946908e-001   -7.425492047305488e-001   -5.387035571768037e-001
   -8.371717186518557e-001    3.083383188043897e-001   -4.517421771833803e-001
    2.365262596913611e-001   -5.298624569028292e-001   -8.144329961643944e-001
   -9.216198633161730e-001   -3.505395993947252e-001   -1.665497427114915e-001
   -4.613985430237507e-001    8.833529304946993e-001   -8.245595601281291e-002
   -9.893259526154994e-001    8.269445759577672e-002    1.199824410669122e-001
    4.607471702265104e-001    8.367862633581816e-001   -2.958053322428704e-001
   -2.401862545746563e-001   -3.840877068281150e-001   -8.915083827855566e-001
   -4.862110993140769e-001   -5.350584268645314e-001    6.908771574925963e-001
    5.970005669912240e-001    1.065271822893886e-001   -7.951366438830753e-001
   -2.779089649068258e-001   -6.064074995607628e-001   -7.450077527790433e-001
    4.084652929837027e-001    6.220730015253015e-001    6.679680270799197e-001
   -3.931723480727353e-001    7.774035432322568e-001    4.909778362420288e-001
   -8.875946172423588e-001   -3.082139953263806e-001    3.423155394184442e-001
   -9.389582087798508e-001    3.371781634537030e-001    6.832545832207748e-002
    7.399155522400684e-001    6.115379659228430e-001    2.802611135855743e-001
    2.859397816778745e-002    5.376128945229513e-001   -8.427068055113797e-001
   -4.218493087187855e-001    1.372307609207314e-001   -8.962203294896852e-001
    6.749377401979737e-001   -1.898336848794539e-001   -7.130373194591857e-001
   -1.657262939360611e-001    2.184059003266697e-001    9.616827222118088e-001
    2.313329044413390e-001   -2.917469803043686e-001   -9.280995565164422e-001
   -1.532836869332839e-001   -9.682038452580226e-001    1.977003423055154e-001
   -6.617545382777865e-002   -8.681137549122142e-001    4.919342617087202e-001
   -7.607064748865288e-001   -5.627330470134023e-001    3.235076148481255e-001
    3.194726192560388e-001   -9.467690088134093e-001    3.956879447443798e-002
   -7.311721949412485e-001    5.670246458662569e-001   -3.793023494852660e-001
    6.381572724181875e-002    2.405889234803086e-001   -9.685269861264496e-001
   -4.936450160055050e-001   -3.353006798919019e-001   -8.024263531545766e-001
    4.580627007982367e-001   -9.258059977484631e-002   -8.840856263296869e-001
    8.800744707359575e-001    2.558924927667803e-001   -3.999849473473067e-001
   -5.705696782450148e-001   -5.372672953814258e-001   -6.211232531317017e-001
   -7.614083548848084e-001    4.242201922367375e-001    4.901984757322642e-001
    2.376623496707991e-001    9.461762761217312e-001   -2.196976605550642e-001
    7.390715367074667e-001   -2.887415006339937e-001    6.086062844240875e-001
    5.453205046308872e-001   -1.919656823176051e-001    8.159501970349973e-001
    5.115299707906313e-001    7.305455817565960e-001    4.523717961575994e-001
   -8.514224515624788e-001    5.070543046289793e-001   -1.340736407074894e-001
    8.627189992217210e-001    3.679975469285026e-001    3.468338706592491e-001
    6.851732320867249e-002    9.435399117661355e-001    3.240953738094259e-001
   -8.035315287033755e-001   -2.327439210584445e-002   -5.948070149651228e-001
   -5.831189072189828e-002    8.251245550967369e-001    5.619334408778760e-001
    8.752639103729500e-002    2.588819198810811e-001    9.619351757944358e-001
   -2.027606081534923e-001   -5.318319320049897e-001    8.222182994078069e-001
   -2.777930507985744e-001    9.237607645201947e-001   -2.636229710421419e-001
   -2.775335531344705e-001    7.910854690058115e-001   -5.451228371774670e-001
    3.021006210958276e-001   -6.284056653876785e-001    7.168274091036030e-001
    8.448605308923309e-001   -2.499016927101658e-001   -4.730325858975495e-001
   -1.170957643407208e-002    9.014983043617715e-001   -4.326241937901595e-001
    7.148701832925757e-001   -6.813436184046493e-001   -1.572625025188743e-001
    9.531499903897809e-001   -2.332447363855749e-001   -1.926187653588928e-001
   -1.982726652342319e-001    9.788375623338136e-001    5.064559986130873e-002
    6.247438564727262e-001   -7.137543834997673e-001    3.166224784099398e-001
   -3.795680644705131e-001   -8.719657653861659e-001   -3.091986229410253e-001
   -4.387804785417546e-001    2.022110204724384e-001    8.755469118500527e-001
    3.209699063984928e-001   -3.898573866149750e-002    9.462866539096704e-001
    6.766480891962727e-001    4.951932494539014e-001    5.449137629775184e-001
    8.709670292433338e-001   -4.849844658591323e-001   -7.878135468734829e-002
    3.149850629366521e-002   -9.994929361979832e-001   -4.659891801581374e-003
    4.194579930907289e-001   -6.502449973174916e-001   -6.334322659099971e-001
   -4.896544541934903e-001    7.857211193931379e-001   -3.779958174743068e-001
    3.453808847752449e-001   -3.571620624901166e-001    8.678405991595894e-001
    8.825076507236948e-001   -2.657930836721775e-001    3.879874780017780e-001
    7.574355179213651e-001    2.307886160265456e-001    6.107602237406632e-001
   -5.506703271062252e-001   -7.020498308611075e-001    4.515398385885938e-001
   -6.600665664690401e-001    7.446336323754987e-001    9.916088626592083e-002
    5.397460506616861e-001    9.468981003627008e-002    8.364855292653948e-001
    1.265965401107598e-001    9.903839815894825e-001    5.579323474175151e-002
   -6.097400382582824e-001    1.090409358711017e-002    7.925264579102908e-001
    1.236847022018164e-001   -9.515484759815108e-001    2.815272496553614e-001
   -6.395495194557291e-001    6.810885972484901e-001    3.565034850629511e-001
   -8.917921193467600e-001   -2.223216509981056e-001   -3.940557059204839e-001
    8.182086497896924e-001    2.324287869989848e-003   -5.749166923087430e-001
   -2.419161906196103e-001    6.677550056334775e-001    7.039742958145069e-001
   -3.346726461613598e-001   -8.563812958024041e-001    3.931987997325890e-001
   -9.049160822023820e-001    2.685951114956481e-001    3.301265670195784e-001
    1.506603374995199e-003    7.625067171064128e-001   -6.469785440908156e-001
    7.010841656988121e-001    7.125838002420325e-001   -2.655786585973612e-002
    5.778186265420763e-001   -6.909219293837230e-001   -4.344565827763486e-001
    4.965182723421733e-001   -8.491184076611406e-001   -1.801874995701769e-001
    8.016376628737211e-001   -4.818673487002756e-001   -3.538091515477312e-001
   -3.019182159957703e-001   -7.135543154465094e-001    6.322069516840152e-001
    3.541390994697173e-001    1.677879969373715e-001   -9.200177641276947e-001
    3.097125148605590e-001    9.176503765084266e-001    2.489898484530863e-001
    9.646189615525272e-001    2.015412781817366e-001    1.699746222298960e-001
   -6.772259583253193e-001   -7.225972373534841e-001    1.386298450531685e-001
   -3.395659121745202e-001   -3.367570263124602e-002    9.399792222923749e-001
    5.172860022536301e-001    4.256674870020977e-001   -7.424435213413722e-001
   -7.773194507991292e-001   -6.133980217816603e-001   -1.397044676582889e-001
   -6.101128332131115e-001   -2.644069203767896e-001    7.468944444869917e-001
   -7.988272175455222e-001    1.489806423739643e-001    5.828205939277711e-001
   -2.103648217500706e-001    5.948466167550996e-001   -7.758248154738753e-001
    3.926717624825881e-001   -8.708773899770778e-001    2.956035496666620e-001
   -6.877524710586314e-001    7.083251935504157e-001   -1.589715658050603e-001
   -6.102878727179247e-001   -6.330628606328179e-002   -7.896461400895366e-001
   -3.610761914615496e-001    4.612734889064533e-001    8.104632949071108e-001
    6.578933308250110e-001   -4.613835410482540e-001   -5.952323859684944e-001
    2.751485681863714e-001    4.104603705996605e-001   -8.693765292393044e-001
   -8.785350580751415e-001   -4.717045141077427e-001    7.530606285875011e-002
    5.681612131690818e-001    8.011949518131571e-001    1.878283392870995e-001
    5.461980090359260e-001    3.844699660054304e-001    7.442113813729092e-001
    8.892369870107371e-001    6.738357020929822e-002    4.524566668730993e-001
    9.513706595636454e-001   -4.876415610077405e-004   -3.080480974249673e-001
    4.439781780750254e-001    8.956390463052404e-001   -2.672220287738966e-002
    1.200376252330372e-001   -2.214429654441509e-001    9.677571914399363e-001
    7.215710053466337e-002   -4.936541356956004e-001    8.666596489701481e-001
   -1.515907326807960e-001   -2.575308588979297e-001    9.543050384864339e-001
   -3.907654632772349e-001   -2.952899359136005e-001    8.718407001613711e-001
   -7.940343747610490e-001   -1.272531674265356e-001    5.944039393188306e-001
   -4.773136851713339e-001    6.322111003263626e-001   -6.103120272223795e-001
    7.135389212197900e-001    4.915896982655984e-001   -4.992011382835944e-001
    2.972831042948580e-001    6.387679462668646e-001   -7.096465787438312e-001
   -6.231658226757018e-001    3.251973075113008e-001    7.112742569756876e-001
    7.529538673354109e-001   -3.210617852235845e-002    6.572896370439283e-001
   -6.721030370735439e-001    1.833090392579015e-001   -7.174087424076066e-001
   -2.988643076096553e-002    9.878151178701992e-001   -1.527353729934708e-001
    7.242293963208291e-001    2.687923326421274e-001   -6.350137505736168e-001
   -9.757985260108439e-001   -1.917674342123589e-001    1.050832422923511e-001
   -4.155723055328491e-001    8.860061280469174e-001    2.056521333159992e-001
   -1.413555935108105e-001   -8.036543548814330e-001   -5.780642473491283e-001
   -9.482155014006731e-001    2.499459349211513e-001   -1.959958992424633e-001
   -8.112755751462049e-001    5.481288345763721e-001    2.034372676702640e-001
    9.740048045433277e-001   -6.790892185537688e-002    2.161088130062135e-001
    3.504249846572920e-001    2.494122781982123e-001    9.027712033577025e-001
    6.635705154352810e-001    6.853949278018150e-001   -2.998465674115686e-001
   -2.032369779116864e-001    9.206010117746609e-001    3.334494083497455e-001
    1.789001137974294e-003   -6.895003471358514e-001    7.242831426827969e-001
   -2.005023721539638e-001    3.578407984182749e-001   -9.120026106037225e-001]';
x(1)=acos(y(3,2));
for i=3:d
    x(i-1)= acos(y(3,i));
    ss=sin(x(i-1));
    s=y(2,i)/ss;
    s1=y(1,i)/ss;
    if y(2,i) >0
        x(d+i-3)=acos(s1);
    else
        x(d+i-3)=2*pi-acos(s1);
    end
end
for i=3:d
YY(:,i)=[cos(x(d+i-3))*sin(x(i-1)), sin(x(d+i-3))*sin(x(i-1)), cos(x(i-1))]';
end
YY(:,1:2)=[0 sin(x(1)) 
           0  0
           1  cos(x(1))];
[xm,xn]=size(x);
    if xn>xm
       x=x';
    end
 G=gramG(y,t);
 e=ones(d,1);
 Ge=G*e;
 Ge1=Ge(1)*e-Ge;
 cx1=Ge1(2:d);
 fx0=max(abs(cx1))
 log(det(G))
  
