home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / qbasic / spoke.bas < prev    next >
BASIC Source File  |  1994-03-05  |  11KB  |  236 lines

  1.  
  2. '     * ***************************************************** *
  3. '     * *                                                   * *
  4. '     * *      Spoke.bas 1.0, by Roger Marquis, 3/89        * *
  5. '     * *    Thanks to Rik & Jon Hjertberg @ Wheelsmith     * *
  6. '     * *       Runs under Microsoft QuickBasic (C)         * *
  7. '     * *                                                   * *
  8. '     * *           Public  Domain,   Freeware.             * *
  9. '     * *                                                   * *
  10. '     * ***************************************************** *
  11.  
  12. BEGIN:
  13.  rimdiam = 0         ' rim diameter
  14.  HUBWID = 0          ' hub width
  15.  HUBDIAM = 0         ' hub diameter
  16.  NCROSS$ = ""        ' number of spoke crosses, input
  17.  NCROSS = 0          ' number of spoke crosses, output
  18.  NSPKS = 0           ' number of spokes
  19.  'Q and Q$           ' misc input variable
  20.  
  21. '*************************************************************************
  22.  
  23.  CLS : LOCATE 3, 1
  24.  PRINT "           Input rim diameter, spoke tip to opposite tip in mm"
  25.  PRINT "               or RETURN for a list of common rim diameters"
  26.  LOCATE 10, 5
  27.  INPUT ; rimdiam
  28.  WHILE rimdiam < 99
  29.      IF rimdiam < 99 THEN GOSUB RIMMENU
  30.      PRINT : PRINT "? ", : Q$ = INPUT$(1): Q = VAL(Q$)
  31.      ON Q GOSUB RIMCHART1, RIMCHART2, RIMCHART3, RIMCHART4, RIMCHART5
  32.      PRINT : PRINT : PRINT "DIAMETER (or ENTER for menu)  ";
  33.      INPUT ; rimdiam
  34.  WEND
  35.  
  36.  '************************************************************************
  37.  
  38.  CLS : LOCATE 2, 1
  39.  PRINT "          Input effective hub diameter in mm"
  40.  PRINT "          measured from center of spoke hole, across"
  41.  PRINT "          axle, to opposite spoke hole"
  42.  PRINT
  43.  PRINT "          And the width of the hub in mm"
  44.  PRINT "          measured from flange to opposite flange"
  45.  PRINT
  46.  PRINT "          or RETURN for a list of common hub dimensions"
  47.  LOCATE 12, 1
  48.  WHILE HUBDIAM = 0 OR HUBDIAM > 99
  49.      INPUT "DIAMETER"; HUBDIAM: IF HUBDIAM = 0 THEN GOSUB HUBCHART
  50.  WEND
  51.  PRINT
  52.  WHILE HUBWID = 0 OR HUBWID > 99
  53.      INPUT "WIDTH"; HUBWID:    IF HUBWID = 0 THEN GOSUB HUBCHART
  54.  WEND
  55.  
  56.  '************************************************************************
  57.  
  58.  WHILE NCROSS$ < "0" OR NCROSS > 9
  59.       CLS : LOCATE 2, 22: PRINT "Input cross pattern:"
  60.       LOCATE 9, 6: INPUT ; NCROSS$: NCROSS = VAL(NCROSS$)
  61.  WEND
  62.                       
  63.  '************************************************************************
  64.  
  65.  WHILE NSPKS < 10 OR NSPKS > 99
  66.      CLS : LOCATE 3, 20: PRINT "Input number of spokes:"
  67.      LOCATE 8, 6: INPUT NSPKS
  68.  WEND
  69.  
  70.  '************************************************************************
  71.  
  72.                       Y = 720 * (NCROSS / NSPKS)
  73.               A = (HUBDIAM / 2) * SIN(Y * (3.1415 / 180))
  74.       B = (rimdiam / 2) - (HUBDIAM / 2) * COS(Y * (3.1415 / 180))
  75.                             C = HUBWID / 2
  76.                 LENGTH% = SQR(A ^ 2 + B ^ 2 + C ^ 2) - .5
  77.  
  78.  '************************************************************************
  79.  
  80.  CLS : LOCATE 2, 23
  81.  PRINT "RIM SIZE =    "; rimdiam: PRINT
  82.  PRINT "       CROSS    =   "; NCROSS, "           HUB DIAMETER = "; HUBDIAM
  83.  PRINT "       SPOKES   =   "; NSPKS, "           HUB WIDTH =    "; HUBWID
  84.  PRINT : PRINT
  85.  PRINT "                         Spoke length is :"
  86.  PRINT : PRINT
  87.  PRINT "                       ", LENGTH%
  88.  PRINT : PRINT
  89.  PRINT "    Add and subtract 1mm for each side of a dished 6/7 spd. rear wheel."
  90.  PRINT
  91.  PRINT "              NOTE: For non-Wheelsmith (DT) spokes or spokes"
  92.  PRINT "                heavier than 1.8mm (15):   add 1 to 1.5 mm"
  93.  PRINT "                (depending on resaler measurement method)."
  94.  PRINT : PRINT : PRINT
  95.  PRINT "                    RUN AGAIN  ?  (enter N to quit)"
  96.  
  97.  Q$ = INPUT$(1)
  98.  IF Q$ = "N" OR Q$ = "n" THEN END ELSE GOTO BEGIN
  99.  
  100.  '*************************************************************************
  101.  '           Menu  screens:
  102.  '*************************************************************************
  103. RIMMENU:
  104.  CLS : LOCATE 5, 1
  105.  PRINT "          ENTER :": PRINT
  106.  PRINT "                   1   for   700c   clincher   rims": PRINT
  107.  PRINT "                   2   for   27in   clincher   rims": PRINT
  108.  PRINT "                   3   for   26in   clincher   rims": PRINT
  109.  PRINT "                   4   for   24/20in   rims": PRINT
  110.  PRINT "             or    5   for   27/26in   sew-up   rims":
  111.  RETURN
  112.  
  113. '***************************************************************************
  114.  
  115. RIMCHART1: CLS
  116.  PRINT "                              700c   rims :"
  117.  PRINT
  118.  PRINT "  Ambrosio        Aero            605 |  Nisi            Mixer           612"
  119.  PRINT "                  Elite           614 |  Rigida          1320            610"
  120.  PRINT "  Araya           1W              605 |                  Score           612"
  121.  PRINT "                  CT19            611 |                  HLC2000         606"
  122.  PRINT "                  CTL730          609 |  Specialized     HC19            613"
  123.  PRINT "  Campagnolo      V-profil        597 |                  HC20            614"
  124.  PRINT "                  Std.            613 |  Sun/Mistral     M132            610"
  125.  PRINT "  Galli           Aero            609 |                  M17             612"
  126.  PRINT "  Matrix          Iso-C           597 |  Weinman         Concave         617"
  127.  PRINT "  Mavic           E2 / G40        613 |  Wolber          58 / Gtlmn      613"
  128.  PRINT "                  MA2 / MA40      611 |                  Alpine          612"
  129.  PRINT "                  M3CD            613 |                  TX              602"
  130.  PRINT "                  OPEN4CD         605 |"
  131.  PRINT
  132.  RETURN
  133.  
  134. '*****************************************************************************
  135.  
  136. RIMCHART2: CLS : LOCATE 3, 1
  137.  PRINT "                           27in   Clinchers :"
  138.  PRINT
  139.  PRINT "                    Araya           1W              617"
  140.  PRINT "                    Matrix          Iso-C           609"
  141.  PRINT "                                    Titan           621"
  142.  PRINT "                    Mavic           MA2 / MA2       618"
  143.  PRINT "                                    E2 / G40        620"
  144.  PRINT "                    Rigida          1320            617"
  145.  PRINT "                                    steel 1-1/4     625"
  146.  PRINT "                    Sun/Mistral     M17             619"
  147.  PRINT "                    Ukai            16A(2)          624"
  148.  PRINT "                    Weinmann        concave         624"
  149.  PRINT "                    Wolber          58 / Gtlmn      620"
  150.  PRINT
  151.  RETURN
  152.  
  153. '***************************************************************************
  154.  
  155. RIMCHART3: CLS : LOCATE 3, 1
  156.  PRINT "                           26in   Clinchers :"
  157.  PRINT
  158.  PRINT "                    Araya           RM20 / RM25     547"
  159.  PRINT "                    Mavic           Oxygen          541"
  160.  PRINT "                                    Bontrager MA40  546"
  161.  PRINT "                    Rigida          steel 1-3/8     581"
  162.  PRINT "                    Ritchey         Vantage         544"
  163.  PRINT "                    Specialized     X22             554"
  164.  PRINT "                                    X26             547"
  165.  PRINT "                                    X28             543"
  166.  PRINT "                                    X32             549"
  167.  PRINT
  168.  RETURN
  169.  
  170.  '***************************************************************************
  171.  
  172. RIMCHART4: CLS
  173.  PRINT "                             24in   Rims :": PRINT
  174.  PRINT "                    SEW-UP:"
  175.  PRINT "                    Ambrosio        aero            505"
  176.  PRINT "                    Araya           ADX4            506"
  177.  PRINT "                    Assos           16mm            505"
  178.  PRINT "                    Fiamme          red             515"
  179.  PRINT "                    Mavic           CX18            517"
  180.  PRINT "                                    Mach2           503"
  181.  PRINT "                    Nisi            Laser           506"
  182.  PRINT
  183.  PRINT "                             20in   Rims":
  184.  PRINT
  185.  PRINT "                    SEW-UP:"
  186.  PRINT "                    Araya           aero            400"
  187.  PRINT
  188.  RETURN
  189.  
  190. '****************************************************************************
  191.  
  192. RIMCHART5: CLS
  193.  PRINT "                           26/27in   Sew-up   Rims :"
  194.  PRINT
  195.  PRINT "      Ambrosio   Aero        604  |   Matrix     Iso         610"
  196.  PRINT "                 20          617  |   Mavic      GP/GL/GEL   615"
  197.  PRINT "                 Synthesis   617  |              Mach 2      602"
  198.  PRINT "                 Crono       617  |   Mistral    M19A        602"
  199.  PRINT "                 std.        616  |   Nisi       Laser       615"
  200.  PRINT "      Araya      ADX-4       611  |   Saavedra   aero        608"
  201.  PRINT "                 (26in)ADX4  558  |              (26in)aero  552"
  202.  PRINT "      Assos      16mm        616  |   Sun        M17         612"
  203.  PRINT "                 18mm        625  |              M19         603"
  204.  PRINT "                 (26in)16mm  558  |   Wolber     Aspin       614"
  205.  PRINT "      Campagnolo all         616  |              Profil-18   611"
  206.  PRINT "      Fiamme     Red         614  |              Profil-20   600"
  207.  PRINT : PRINT : PRINT
  208.  RETURN
  209.                                                                            
  210. '*******************************************************************************
  211.  
  212. HUBCHART: CLS
  213.  PRINT "                              Flange   DIAMETERS /  WIDTHS :"
  214.  PRINT
  215.  PRINT "     Campagnolo      LF      Rear            44       57"
  216.  PRINT "                             Front           39       70"
  217.  PRINT "                     HF      Rear            67       57"
  218.  PRINT "                             Front           67       68"
  219.  PRINT "            track    HF      Rear            67       75"
  220.  PRINT "                             Front           67       64"
  221.  PRINT "     Shimano         LF      Rear cassette   44       55"
  222.  PRINT "                             Rear standard   44       56"
  223.  PRINT "                             Front           38       71"
  224.  PRINT "     Specialized     MF      Rear            46       51"
  225.  PRINT "                             Front           43       66"
  226.  PRINT "     Mavic           LF      Rear            44       56"
  227.  PRINT "                             Front           40       56"
  228.  PRINT "     Suntour         LF      Rear            44       55"
  229.  PRINT "                             Front           38       66"
  230.  PRINT "             track   HF      Rear            67       66"
  231.  PRINT "                             Front           67       64"
  232.  PRINT
  233.  RETURN
  234.  
  235. '********************************************< end of program >***********
  236.