subject

Given n points P1(x1, y1, z1), P2(x2, y2, z2) . . . Pn(xn, yn, zn), implement the function centerPoint() that finds the center point using the following formula: C(xc, yc, zc)=(x1 +x2 +...+xn, y1 +y2 +...+yn, z1 +z2 +...+zn)
nnn
centerPoint() takes three arguments: a pointer to an array of struct point*, the number of points in the array, and a pointer to struct point center. It then calculates the coordinates of the center point (for all the points in the array) and stores it in struct point center. You may not use any square brackets ([]) in centerPoint().
struct point { float x;
float y;
float z; };
void centerPoint(struct point** points, int n, struct point* center) {
}
int main(void) {
struct point center;
struct point* points[100];
setPoints(points, 100);//Dynamically allocates the points
//and initializes the points
centerPoint(points, 100, &center);
printf("center point is (%f, %f, %f)\n, center. x, center. y, center. z); return 0;
}

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 01:40
Kali, a python programmer, is using the turtle module to write the word “hello.” which code should she use to indicate the location to begin writing the word? a # pick up the turtle and move it to its starting location. b penup(-100, 200) goto() pendown() c penup() goto(-100, 200) pendown() d # pick up the turtle and move it to (-100, 200)
Answers: 2
question
Computers and Technology, 23.06.2019 09:30
Why is an outfitting a workspace with video games in a technology development company considered a strategic use of money
Answers: 1
question
Computers and Technology, 24.06.2019 11:00
Which of the statements below describe the guidelines for the use of text in presentation programs? a. do not use numbered lists. b. fonts should be appropriate for your audience. c. limit the number of fonts you use to three or four. d. only use bulleted lists for sales promotions. e. select font sizes that are appropriate for your delivery method. f. use font colors that work well with your background. select all that apply
Answers: 1
question
Computers and Technology, 24.06.2019 16:00
This isn't about school but every time it tells me to watch an ad to unlock the answer to a question it prompts a survey and it just keeps loading. so i haven't been able to get answers for my tests in like a week.
Answers: 2
You know the right answer?
Given n points P1(x1, y1, z1), P2(x2, y2, z2) . . . Pn(xn, yn, zn), implement the function centerPoi...
Questions
question
History, 24.09.2019 06:10
question
Chemistry, 24.09.2019 06:10
question
Chemistry, 24.09.2019 06:10
Questions on the website: 13722360