Question
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started