Skip to content

shradham2612/Convex_hull_sum

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Convex_hull_sum

Aim :

Implement a solution for Finding a summation of elements from a matrix. Example: Accept a 2D matrix dimension. Populate using random number [non-zero]

Accept any five dimension values from the user
Check the region covered by these points in the matrix. Calculate the boundary by either considering all points or ignoring few points which may not come on boundary [convex hull] Find sum of elements in the region.

We have used vector to make the array dynamic and for ease in creating a matrix of desired dimentions

step 1 : Creating a Matrix
step 1 : Accepting the dimentions of polygon
step 2 : Eliminating the incorrect dimentions
step 3 : Travering each point throughout the matrix within max and min ranges of polygon dimentions
step 4 : checking whether the point lies inside the polygon
step 5 : Implementing step 4 using isInside,doIntersect,orientation,onSegment functions
step 6 : By evaluating the result generated by step 5 we add the element of the matrix to variable sum
step 7 : Printing the sum

Test cases in png files

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages