Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

C++ OpenGL Mathematics // Complete the constructor and the checkPoint methods fo

ID: 3789533 • Letter: C

Question

C++ OpenGL Mathematics

// Complete the constructor and the checkPoint methods for the Circle struct.
// The constructor should assign the input arguments to the data members using an
// initializer list.
// The checkPoint method should return a negative value for points that are inside the
// circle, zero for points that are on the circle, and positive values for points
// that are outside the circle.
// Test the checkPoint function using using the following values:
// Circle c with center at (0, 0) and radius = 1
// vec2 p = [0.5 0] (inside circle)
// vec2 q = [1 0] (on circle)
// vec2 r = [2 0] (outside circle)
// Then test your function for points of your choosing on a Circle that is NOT
// centered on the origin.
// Display all the results to the console.
struct Circle {

   glm::vec2 center;
   float radius;

   Circle(float r = 1.0, glm::vec2 ctr = glm::vec2(0.0, 0.0))
   {

   } // end Circle constructor

   float checkPoint(glm::vec2 pt)
   {


   } // end checkPoint

}; // end Circle struct


void problem1()
{
   std::cout << "Problem 1" << std::endl;

} // end Problem1

Explanation / Answer

==============================================================

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote