struct PT3
double x, y, z;
}; int solveCenterPointOfCircle(std::vector<PT3> pt, double centerpoint[])
double a1, b1, c1, d1;
double a2, b2, c2, d2;
double a3, b3, c3, d3; double x1 = pt[].x, y1 = pt[].y, z1 = pt[].z;
double x2 = pt[].x, y2 = pt[].y, z2 = pt[].z;
double x3 = pt[].x, y3 = pt[].y, z3 = pt[].z; a1 = (y1*z2 - y2*z1 - y1*z3 + y3*z1 + y2*z3 - y3*z2);
b1 = -(x1*z2 - x2*z1 - x1*z3 + x3*z1 + x2*z3 - x3*z2);
c1 = (x1*y2 - x2*y1 - x1*y3 + x3*y1 + x2*y3 - x3*y2);
d1 = -(x1*y2*z3 - x1*y3*z2 - x2*y1*z3 + x2*y3*z1 + x3*y1*z2 - x3*y2*z1); a2 = * (x2 - x1);
b2 = * (y2 - y1);
c2 = * (z2 - z1);
d2 = x1 * x1 + y1 * y1 + z1 * z1 - x2 * x2 - y2 * y2 - z2 * z2; a3 = * (x3 - x1);
b3 = * (y3 - y1);
c3 = * (z3 - z1);
d3 = x1 * x1 + y1 * y1 + z1 * z1 - x3 * x3 - y3 * y3 - z3 * z3; centerpoint[] = -(b1*c2*d3 - b1*c3*d2 - b2*c1*d3 + b2*c3*d1 + b3*c1*d2 - b3*c2*d1)
/(a1*b2*c3 - a1*b3*c2 - a2*b1*c3 + a2*b3*c1 + a3*b1*c2 - a3*b2*c1);
centerpoint[] = (a1*c2*d3 - a1*c3*d2 - a2*c1*d3 + a2*c3*d1 + a3*c1*d2 - a3*c2*d1)
/(a1*b2*c3 - a1*b3*c2 - a2*b1*c3 + a2*b3*c1 + a3*b1*c2 - a3*b2*c1);
centerpoint[] = -(a1*b2*d3 - a1*b3*d2 - a2*b1*d3 + a2*b3*d1 + a3*b1*d2 - a3*b2*d1)
/(a1*b2*c3 - a1*b3*c2 - a2*b1*c3 + a2*b3*c1 + a3*b1*c2 - a3*b2*c1); return ;

Refer to :

We know three points in space , Calculate the center coordinates of circumscribed circle ,C++ More articles on programming implementation

  1. The surface composed of three points in a given space is used to find the Z value

    There are three known points in space , Then you can determine the plane of three points in space . At this time, according to a certain point X Values and Y value , To find the point on the plane Z value . This process is particularly useful for finding the elevation or weight of a point on a triangular patch , It can also be regarded as a linear interpolation . The algorithm ...

  2. Given the straight line composed of two points in space, find a point on the line Z value

    Given the straight line composed of two points in space, find a point on the line Z value , Why is there such a strange evaluation requirement ? Because the geometric calculation of real three-dimensional space is more troublesome , Many times you need to project into two dimensions , Back to three-dimensional space . Review the space linear equation : In known space ...

  3. 【C Language 】 We know the three sides of a triangle , Find triangle area

    One . Mathematical basis : We know the three sides of a triangle , Calculate the area of the triangle , You need to use Helen's formula : namely p=(a+b+c)/2 Two . Algorithm : Enter three side lengths , Apply Helen formula to calculate area , And the output . You can first judge whether you can form a triangle , That is, on either side ...

  4. golang Realize the known triangle three-point coordinates , Find triangle area

    The code is as follows : func GetTriangleAreaByVector(x vector.Vector3,y vector.Vector3,z vector.Vector3) float64 { // root ...

  5. It is known that TSP The best solution of the problem

    a280 : 2579ali535 : 202339att48 : 10628att532 : 27686bayg29 : 1610bays29 : 2020berlin52 : 7542bier12 ...

  6. js It is known that A,B Two point coordinates , In the line segment AB There are C spot , It is known that AC Distance of , seek C The coordinates of point

    /** * @param {Number} _x1 A Point coordinates * @param {Number} _y1 A Point coordinates * @param {Number} _x2 B Point coordinates * @param {Numbe ...

  7. Special topic on space spectrum 13: Joint solution DOA(ML/AP)

    Among them, the author : guangxi . Time :2017-10-16  07:51:40 link : Preface It is mainly recorded in two-dimensional direction finding , Separate interest ...

  8. 【 turn 】GPS Baseline solution mode

    GPS The baseline vector is using 2 Taiwan or 2 Table above GPS Pick up The difference observation value formed by synchronous observation data collected by receiver , Three dimensional coordinate difference between two receivers calculated by parameter estimation method . It is different from the baseline side length measured in conventional ground survey , The baseline vector is Both have length ...

  9. Layout : The height is known , Layout a three column layout , The width of the left and right columns is 200px, Intermediate adaptation

    demand : The altitude is known as 200px, Write a three column layout , Left and right columns 200px, Intermediate adaptation , As shown in the figure below : Method 1 :float Floating layout The principle is : Define three blocks , It's important to note that the middle block is placed below the right block , Set the height to ...

Random recommendation

  1. HTTP error 500.21 - Internal Server Error The handler “PageHandlerFactory-Integrated” There is an error module... In its module list “ManagedPipelineHandler”

    HTTP error 500.21 - Internal Server Error The handler “PageHandlerFactory-Integrated” There is an error module... In its module list “ManagedPipe ...

  2. React Native02- Began to run Android piece

    1. Began to run 1) Use the command to enter the new file directory , such as HelloWorld, Input again react-native start: After waiting for a while , We see an address at the back , It indicates that it has run successfully . So let's type in the address ...

  3. Linphone iOS Open at client compile time G729 Support

    Assuming you were able to compile the SDK and the linphone XCode project, here is what you need to d ...

  4. uva 1422 - Processor( Two points + Priority queue )

    Topic link :uva 1422 - Processor The main idea of the topic : There is a machine to deal with some problems , Give the time when these problems can start and must be completed , And the workload of the task , How much work does the machine have to do per second to accomplish these tasks ...

  5. LED The production of colorful color changing lamp

    LED Color changing lamp is a new type of bulb . Its shape is the same as the general milky white incandescent bulb , But when it is on, it will change color automatically at a certain time interval . Circularly emit green . yellow . green . purple . blue . red . White light . It's for family birthday parties . Festival parties . It's Chinese New Year , Add joy to the festival ...

  6. .NET Synchronous and asynchronous lock (Lock、Monitor)( 7、 ... and )

    This essay continues :.NET Background knowledge of synchronization and asynchrony ( 6、 ... and ) It has been mentioned in the last essay . A typical solution to competitive conditions is locking , The essay focuses on .NET The most commonly used locks provided lock keyword and Monitor. One ...

  7. web Container start sequence

    web Container start sequence : First of all :context-param second :Listerer Third :Filter Fourth :servlet

  8. Front end development specifications : Naming specification 、html standard 、css standard 、js standard

    Last week's group training was on the art of code readability , Mainly share how to name . How to optimize code layout , How to write good notes . We all know that writing elegant code is the only way to become a great bull . Next, I would like to thank a front-end development partner for summarizing the front-end development specifications , By learning the relevant development rules ...


    """ Django settings for sitea project. For more information on this file, see https:/ ...

  10. technology Leader Related articles and thoughts

    Reference article : You and good technology Leader There's only one difference between them “ Manual ” How to be a good technical director ? You have to do these three things