Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

We wish to write a set of C functions to work with 3-D vectors, Write C functions as follows: . VectorMagnitude -Input. An array that

image text in transcribed
We wish to write a set of C functions to work with 3-D vectors, Write C functions as follows: . VectorMagnitude -Input. An array that represents a 3-D vector pNa vrVJ -Output: The magnitude of the input vector Ipl = /+1 ? DotProduct Input: Two arrays of three elements each, that represent vectors and Output 1: The dot product of these two vectors p. V, * V, +1. Output2: The angle between the two vectors (in degrees) cos must call the function VectorMagnitude twice. 2 +1, * 14 "(R ) ( Note that this calculation . CrossProduct -Input: Two arrays of three elements each, that represent vectors , and -Output: A 3-element array that represents the cross product of the two input vectors. The cross product is described below - Output2: The angle between the two input vectors (in degrees). The method for calculating the angle between the two input vectors, using the cross product is described below The cross product of two vectors is defined as the formal determinant of the following matrix Va The cross product can be used to find the gle between two vectors 180 where G = pi G. Note that this calculation requires three calls to Vectorlagnitude. Also note that the value inside the parenthesis of the sin-| function might need limiting between HINT: Your functions will have to pass arrays back and forth. A pointer argument may also be essary for the angle between the two vectors. Write a C program that prompts the user to choose between the following options M for vector magnitude. This option prompts the user to enter in a single 3-D vector D for dot product. This option prompts the user to euter in two 3-D vectors. C for cross product. This option prompts the user to enter in two 3-D vectors. Print the output of the appropriate calculations to the screen

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Marketing The Ultimate Marketing Tool

Authors: Edward L. Nash

1st Edition

0070460639, 978-0070460638

More Books

Students also viewed these Databases questions

Question

Describe Balor method and give the chemical reaction.

Answered: 1 week ago

Question

How to prepare washing soda from common salt?

Answered: 1 week ago

Question

What is the difference between Needs and GAP Analyses?

Answered: 1 week ago

Question

What are ERP suites? Are HCMSs part of ERPs?

Answered: 1 week ago