Results 1 to 7 of 7

Thread: ++

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date: Nov:2010
    Location: LULIN
    Posts: 13

    ++

    ,
    1- ++.
    : , .
    :
    Code:
    #include <iostream>
    #include <cmath>
    #include "ccc_win.h"
    using namespace std;
    int ccc_win_main()
    {
        
        cwin.clear();
        cwin << Message(Point(-10,9),"Georgi Hristov, Faculty number: 54570");
        cwin << Message(Point(-10,8),"Homework number: ");
        cwin << Message(Point(-6,8), 54570%25);
        double x3=cwin.get_double("Enter the X coordinate of the Circle middle: ");
        double y3=cwin.get_double("Enter the Y coordinate of the Circle middle: ");
        double r =cwin.get_double("Enter the radius of the circle: ");
        Circle c1(Point(x3, y3),r);
            double x1=cwin.get_double("Enter the X coordinate for the first dot: ");
            double y1=cwin.get_double("Enter the Y coordinate for the first dot: ");
        double x2=cwin.get_double("Enter the X coordinate for the second dot: ");
        double y2=cwin.get_double("Enter the Y coordinate for the second dot: ");
        Line l(Point(x2,y2),Point(x1,y1));
        cwin << c1 << l;
        double i,a,b,c;
        
        a =  pow((x2 - x1),2) + pow((y2 - y1),2);
     b =  2* ((x2 - x1)*(x1 - x3) + (y2 - y1)*(y1 - y3)) ;
     c =  pow(x3,2) + pow(y3,2) + pow(x1,2) + pow(y1,2) - 2* ( x3*x1 + y3*y1 ) - pow(r,2) ;
     i =   b * b - 4 * a * c ;
     
       cwin << Message(Point(-10,-3),i);
        
         if ( i < 0.0 )
     {
      
         cwin << Message(Point(-10,-5),"No intersection!");
         return (1);
     }
    
     if ( i == 0.0  )
     {
     
      cwin << Message(Point(-10,-5),"One intersection!");
         return (1);
     }
     if ( i> 0.0)
     {
     
    cwin << Message(Point(-10,-5),"Two intersections!");
         return (1);
    
    }
       return 0;
    }
    , ...
    : http://local.wasp.uwa.edu.au/~pbourk...ry/sphereline/

    .

  2. #2
    1+1=11 svr's Avatar
    Join Date: Sep:2006
    Location: Inferno, Act 1
    Posts: 790
    , , :

    Code:
    if ( i == 0.0  )
    double- 1 , i , 0.0. - - .


    Code:
    double EPSILON = 0.001d;   //       
    if ( fabs(i) < EPSILON )
    MSI B450 Gaming Pro Carbon AC | Ryzen 9 5900x | HyperX Predator 3200 | Asus Strix 3090 | Kingston KC3000 2TB | WD Red 4TB | Dell G3223Q + LG 27UK650-W | Arctic Freezer 360 | Seasonic Focus GX-1000 | Lian Li O11 Dynamic

  3. #3
    Registered User
    Join Date: Nov:2010
    Location: LULIN
    Posts: 13

  4. #4
    philosophus duratea icaci's Avatar
    Join Date: Oct:2006
    Location: Aachen
    Posts: 2,698
    , , . , , . , .

    , .. [0, 1], . , . , (i > 0.0), [0, 1], , , . , [0, 1], (i == 0.0).
    Internet - it doesn't make you stupid, it just makes your stupidity more accessible to others

  5. #5
    Registered User
    Join Date: Nov:2010
    Location: LULIN
    Posts: 13
    Quote Originally Posted by icaci View Post
    , , . , , . , .

    , .. [0, 1], . , . , (i > 0.0), [0, 1], , , . , [0, 1], (i == 0.0).

  6. #6
    philosophus duratea icaci's Avatar
    Join Date: Oct:2006
    Location: Aachen
    Posts: 2,698
    Quote Originally Posted by qwertyo View Post
    , , C, , , .
    Internet - it doesn't make you stupid, it just makes your stupidity more accessible to others

  7. #7
    ! vbTheKing's Avatar
    Join Date: Sep:2003
    Location:
    Posts: 4,138
    ?
    .
    , - . .
    ''? * *
    - !
    ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |