Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

What would be the answers for these vec.3 questions: #include Vec3.h Vec3::Vec3() { //COMPLETE THIS MEMBER FUNCTION //HERE YOU WILL SET ALL VECTOR COMPONENTS TO

What would be the answers for these vec.3 questions:

#include "Vec3.h"

Vec3::Vec3() { //COMPLETE THIS MEMBER FUNCTION //HERE YOU WILL SET ALL VECTOR COMPONENTS TO 0 }

Vec3::Vec3(float x_, float y_, float z_) { //COMPLETE THIS MEMBER FUNCTION //HERE YOU WILL SET ALL VECTOR COMPONENTS TO THE PARAMETERS SUPPLIED }

Vec3 Vec3::Add(Vec3 b) { //COMPLETE THIS MEMBER FUNCTION //HERE YOU WILL ADD THE COMPONENTS FOR THE TWO VECTORS }

Vec3 Vec3::Subtract(Vec3 b) { //COMPLETE THIS MEMBER FUNCTION //HERE YOU WILL SUBTRACT THE COMPONENTS FOR THE TWO VECTORS }

Vec3 Vec3::ScalarMultiplication(float s) { //COMPLETE THIS MEMBER FUNCTION //HERE YOU WILL MULTIPLY THE SCALAR WITH THE VECTOR COMPONENTS }

float Vec3::Mag() { //COMPLETE THIS MEMBER FUNCTION //HERE YOU WILL CALCULATE THE MAGNITUDE OF THE VECTOR //USE THE FUNCTION sqrt() TO CALCULATE THE SQUARE ROOT //USE THE FUNCTION pow(n, exp) TO CALCULATE THE EXPONENT OF A NUMBER }

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_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions

Question

3. Did you seek anyones advice?

Answered: 1 week ago

Question

7. What traps should she avoid?

Answered: 1 week ago

Question

5. What decision-making model would you advocate to this person?

Answered: 1 week ago