Results 1 to 7 of 7
Thread: ++
Hybrid View
-
13th November 2010 01:02 #1Registered 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/
.
-
13th November 2010 01:19 #2
, , :
double- 1 , i , 0.0. - - .Code:if ( 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
-
13th November 2010 21:20 #3Registered User
Join Date: Nov:2010
Location: LULIN
Posts: 13
, , .
, 1 1 . . , .
http://www.algorithmic-solutions.inf...al/circle.html
-
14th November 2010 01:22 #4
, , . , , . , .
, .. [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
-
16th November 2010 23:35 #5
-
17th November 2010 00:33 #6
-
16th November 2010 23:43 #7




Reply With Quote
.


Lenovo ThinkPad 15 IdeaPad 15
5th May 2023, 22:16 in