function [ x, w ] = rule27 ( n )

%*****************************************************************************80
%
%% RULE27 returns the rule of degree 27.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    07 July 2014
%
%  Author:
%
%    Original FORTRAN77 version by Hong Xiao, Zydrunas Gimbutas.
%    This MATLAB version by John Burkardt.
%
%  Reference:
%
%    Hong Xiao, Zydrunas Gimbutas,
%    A numerical algorithm for the construction of efficient quadrature
%    rules in two and higher dimensions,
%    Computers and Mathematics with Applications,
%    Volume 59, 2010, pages 663-676.
%
%  Parameters:
%
%    Input, integer N, the number of nodes.
%
%    Output, real X(2,N), the coordinates of the nodes.
%
%    Output, real W(N), the weights.
%
  xs = [ ...
    -.3179234344617641,0.9945426115270097, ...
    0.3179234344617642,-.9945426115270097, ...
    -.9658581524130557,0.9842821312283567, ...
    0.9658581524130559,-.9842821312283565, ...
    0.4546608217543911,0.9794570195190775, ...
    -.4546608217543910,-.9794570195190775, ...
    0.9203445363225692,0.9966680243748195, ...
    -.9203445363225690,-.9966680243748197, ...
    0.5921826557247571,0.9227007102569557, ...
    -.5921826557247569,-.9227007102569557, ...
    -.6265556238656111,0.9943315661391944, ...
    0.6265556238656114,-.9943315661391944, ...
    -.9106466233445932,0.9127106311205702, ...
    0.9106466233445935,-.9127106311205699, ...
    -.4796281374834562,0.9651530210115425, ...
    0.4796281374834563,-.9651530210115425, ...
    0.6298732844502039,0.9921721529860120, ...
    -.6298732844502036,-.9921721529860120, ...
    -.8335744040052592,0.9824660135148449, ...
    0.8335744040052594,-.9824660135148449, ...
    0.1959395767367455,0.9899174626675955, ...
    -.1959395767367454,-.9899174626675955, ...
    -.1386302484544642,0.9830581303940688, ...
    0.1386302484544643,-.9830581303940688, ...
    -.7022171903082602,0.9292585099108952, ...
    0.7022171903082605,-.9292585099108952, ...
    0.7970439287784883,0.9675649927064782, ...
    -.7970439287784881,-.9675649927064782, ...
    -.8020178388613470,0.8160591260895965, ...
    0.8020178388613470,-.8160591260895965, ...
    -.5398233377470387,0.8364692379579785, ...
    0.5398233377470387,-.8364692379579785, ...
    -.1520649596611693,0.8369974777769484, ...
    0.1520649596611695,-.8369974777769484, ...
    -.2998875490507344,0.3409328206751328, ...
    0.2998875490507344,-.3409328206751328, ...
    -.3209420000531037,0.9175861963438381, ...
    0.3209420000531039,-.9175861963438381, ...
    -.9020677393268002E-01,0.1670667038911821, ...
    0.9020677393268005E-01,-.1670667038911821, ...
    0.1926515070565072,0.5293872532788142, ...
    -.1926515070565071,-.5293872532788142, ...
    0.4976080851052046,0.7953917795116896, ...
    -.4976080851052045,-.7953917795116896, ...
    0.3002782637358375E-01,0.9362295643614138, ...
    -.3002782637358363E-01,-.9362295643614138, ...
    0.6881617137006012,0.8842713205559528, ...
    -.6881617137006012,-.8842713205559528, ...
    0.2200611683790181,0.8481900686404982, ...
    -.2200611683790180,-.8481900686404982, ...
    0.4531153802420229E-01,0.3769373245611116, ...
    -.4531153802420225E-01,-.3769373245611116, ...
    -.4941549461445193,0.5167583593472795, ...
    0.4941549461445194,-.5167583593472795, ...
    0.3405123948054840,0.6649111597000639, ...
    -.3405123948054839,-.6649111597000639, ...
    -.1521097283009047,0.5602567958473701, ...
    0.1521097283009048,-.5602567958473701, ...
    0.3710843473830662,0.9336952377043988, ...
    -.3710843473830661,-.9336952377043988, ...
    -.3536770731498163,0.7123617422035845, ...
    0.3536770731498164,-.7123617422035845, ...
    -.6668117984035637,0.6750511711635266, ...
    0.6668117984035637,-.6750511711635266, ...
    0.3880331998977081E-01,0.7201416766661869, ...
    -.3880331998977073E-01,-.7201416766661869 ];
  ys = [ ...
    -.9945426115270097,-.3179234344617641, ...
    0.9945426115270097,0.3179234344617642, ...
    -.9842821312283568,-.9658581524130558, ...
    0.9842821312283566,0.9658581524130561, ...
    -.9794570195190775,0.4546608217543910, ...
    0.9794570195190775,-.4546608217543909, ...
    -.9966680243748194,0.9203445363225691, ...
    0.9966680243748196,-.9203445363225689, ...
    -.9227007102569557,0.5921826557247570, ...
    0.9227007102569557,-.5921826557247568, ...
    -.9943315661391944,-.6265556238656113, ...
    0.9943315661391944,0.6265556238656115, ...
    -.9127106311205703,-.9106466233445933, ...
    0.9127106311205700,0.9106466233445936, ...
    -.9651530210115425,-.4796281374834563, ...
    0.9651530210115425,0.4796281374834564, ...
    -.9921721529860120,0.6298732844502037, ...
    0.9921721529860120,-.6298732844502035, ...
    -.9824660135148449,-.8335744040052593, ...
    0.9824660135148449,0.8335744040052595, ...
    -.9899174626675955,0.1959395767367454, ...
    0.9899174626675955,-.1959395767367453, ...
    -.9830581303940688,-.1386302484544642, ...
    0.9830581303940688,0.1386302484544643, ...
    -.9292585099108952,-.7022171903082604, ...
    0.9292585099108952,0.7022171903082606, ...
    -.9675649927064782,0.7970439287784882, ...
    0.9675649927064782,-.7970439287784880, ...
    -.8160591260895965,-.8020178388613470, ...
    0.8160591260895965,0.8020178388613470, ...
    -.8364692379579785,-.5398233377470387, ...
    0.8364692379579785,0.5398233377470387, ...
    -.8369974777769484,-.1520649596611694, ...
    0.8369974777769484,0.1520649596611695, ...
    -.3409328206751328,-.2998875490507344, ...
    0.3409328206751328,0.2998875490507344, ...
    -.9175861963438381,-.3209420000531038, ...
    0.9175861963438381,0.3209420000531039, ...
    -.1670667038911821,-.9020677393268003E-01, ...
    0.1670667038911821,0.9020677393268006E-01, ...
    -.5293872532788142,0.1926515070565072, ...
    0.5293872532788142,-.1926515070565071, ...
    -.7953917795116896,0.4976080851052045, ...
    0.7953917795116896,-.4976080851052044, ...
    -.9362295643614138,0.3002782637358369E-01, ...
    0.9362295643614138,-.3002782637358357E-01, ...
    -.8842713205559528,0.6881617137006012, ...
    0.8842713205559528,-.6881617137006012, ...
    -.8481900686404982,0.2200611683790180, ...
    0.8481900686404982,-.2200611683790179, ...
    -.3769373245611116,0.4531153802420227E-01, ...
    0.3769373245611116,-.4531153802420223E-01, ...
    -.5167583593472795,-.4941549461445193, ...
    0.5167583593472795,0.4941549461445194, ...
    -.6649111597000639,0.3405123948054840, ...
    0.6649111597000639,-.3405123948054838, ...
    -.5602567958473701,-.1521097283009047, ...
    0.5602567958473701,0.1521097283009048, ...
    -.9336952377043988,0.3710843473830662, ...
    0.9336952377043988,-.3710843473830661, ...
    -.7123617422035845,-.3536770731498164, ...
    0.7123617422035845,0.3536770731498165, ...
    -.6750511711635266,-.6668117984035637, ...
    0.6750511711635266,0.6668117984035637, ...
    -.7201416766661869,0.3880331998977077E-01, ...
    0.7201416766661869,-.3880331998977068E-01 ];
  ws = [ ...
    0.2672899331427035E-02,0.2672899331427035E-02, ...
    0.2672899331427035E-02,0.2672899331427035E-02, ...
    0.2445906596530064E-02,0.2445906596530064E-02, ...
    0.2445906596530064E-02,0.2445906596530064E-02, ...
    0.5784555125932030E-02,0.5784555125932030E-02, ...
    0.5784555125932030E-02,0.5784555125932030E-02, ...
    0.1774682379035372E-02,0.1774682379035372E-02, ...
    0.1774682379035372E-02,0.1774682379035372E-02, ...
    0.9666652283416993E-02,0.9666652283416993E-02, ...
    0.9666652283416993E-02,0.9666652283416993E-02, ...
    0.3475754833559290E-02,0.3475754833559290E-02, ...
    0.3475754833559290E-02,0.3475754833559290E-02, ...
    0.9738340699044858E-02,0.9738340699044858E-02, ...
    0.9738340699044858E-02,0.9738340699044858E-02, ...
    0.9913445575624551E-02,0.9913445575624551E-02, ...
    0.9913445575624551E-02,0.9913445575624551E-02, ...
    0.4024564097795350E-02,0.4024564097795350E-02, ...
    0.4024564097795350E-02,0.4024564097795350E-02, ...
    0.5467642658052182E-02,0.5467642658052182E-02, ...
    0.5467642658052182E-02,0.5467642658052182E-02, ...
    0.6791307131143990E-02,0.6791307131143990E-02, ...
    0.6791307131143990E-02,0.6791307131143990E-02, ...
    0.7849471971542231E-02,0.7849471971542231E-02, ...
    0.7849471971542231E-02,0.7849471971542231E-02, ...
    0.1481562369739479E-01,0.1481562369739479E-01, ...
    0.1481562369739479E-01,0.1481562369739479E-01, ...
    0.8652776980870136E-02,0.8652776980870136E-02, ...
    0.8652776980870136E-02,0.8652776980870136E-02, ...
    0.1938931217339045E-01,0.1938931217339045E-01, ...
    0.1938931217339045E-01,0.1938931217339045E-01, ...
    0.2728047644809397E-01,0.2728047644809397E-01, ...
    0.2728047644809397E-01,0.2728047644809397E-01, ...
    0.2833042504936177E-01,0.2833042504936177E-01, ...
    0.2833042504936177E-01,0.2833042504936177E-01, ...
    0.5141433190365619E-01,0.5141433190365619E-01, ...
    0.5141433190365619E-01,0.5141433190365619E-01, ...
    0.1775207295130232E-01,0.1775207295130232E-01, ...
    0.1775207295130232E-01,0.1775207295130232E-01, ...
    0.4944421261124536E-01,0.4944421261124536E-01, ...
    0.4944421261124536E-01,0.4944421261124536E-01, ...
    0.3632695571196309E-01,0.3632695571196309E-01, ...
    0.3632695571196309E-01,0.3632695571196309E-01, ...
    0.2905709329104403E-01,0.2905709329104403E-01, ...
    0.2905709329104403E-01,0.2905709329104403E-01, ...
    0.1861253661440120E-01,0.1861253661440120E-01, ...
    0.1861253661440120E-01,0.1861253661440120E-01, ...
    0.1362514538944166E-01,0.1362514538944166E-01, ...
    0.1362514538944166E-01,0.1362514538944166E-01, ...
    0.2778931208298291E-01,0.2778931208298291E-01, ...
    0.2778931208298291E-01,0.2778931208298291E-01, ...
    0.4496161760244370E-01,0.4496161760244370E-01, ...
    0.4496161760244370E-01,0.4496161760244370E-01, ...
    0.4391754850935400E-01,0.4391754850935400E-01, ...
    0.4391754850935400E-01,0.4391754850935400E-01, ...
    0.3461629438577501E-01,0.3461629438577501E-01, ...
    0.3461629438577501E-01,0.3461629438577501E-01, ...
    0.4733898929183223E-01,0.4733898929183223E-01, ...
    0.4733898929183223E-01,0.4733898929183223E-01, ...
    0.1448889464186536E-01,0.1448889464186536E-01, ...
    0.1448889464186536E-01,0.1448889464186536E-01, ...
    0.3863763742526743E-01,0.3863763742526743E-01, ...
    0.3863763742526743E-01,0.3863763742526743E-01, ...
    0.3295515782263461E-01,0.3295515782263461E-01, ...
    0.3295515782263461E-01,0.3295515782263461E-01, ...
    0.3809514391912308E-01,0.3809514391912308E-01, ...
    0.3809514391912308E-01,0.3809514391912308E-01 ];

  x(1,1:n) = xs(1:n);
  x(2,1:n) = ys(1:n);
  w(1:n) = ws(1:n);

  return
end