We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
When you say 'Points()' you are instantiating a Points object or casting the arguments into one.
In the main function that is used used to turn the scalars in the points[] array into Points objects a, b, c, and d
In the return statements in the class methods, it's being used to turn the three scalar values into a Points object to be returned. That's what makes x and y into Points objects in the main function.
Whoever wrote this problem made it potentially super-confusing by using 'points' as the identifier for an array of arrays of integers instead of an array of Points objects.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Class 2 - Find the Torsional Angle
You are viewing a single comment's thread. Return to all comments →
When you say 'Points()' you are instantiating a Points object or casting the arguments into one.
In the main function that is used used to turn the scalars in the points[] array into Points objects a, b, c, and d
In the return statements in the class methods, it's being used to turn the three scalar values into a Points object to be returned. That's what makes x and y into Points objects in the main function.
Whoever wrote this problem made it potentially super-confusing by using 'points' as the identifier for an array of arrays of integers instead of an array of Points objects.