https://github.com/harshpatel44/binary-space-partition-
We need to partition the space using binary space partition tree (BSP tree) unless a specific condition is specified using C++
https://github.com/harshpatel44/binary-space-partition-
Last synced: 2 months ago
JSON representation
We need to partition the space using binary space partition tree (BSP tree) unless a specific condition is specified using C++
- Host: GitHub
- URL: https://github.com/harshpatel44/binary-space-partition-
- Owner: Harshpatel44
- License: mit
- Created: 2017-12-05T14:08:45.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-02-12T19:39:55.000Z (over 5 years ago)
- Last Synced: 2025-01-24T15:41:51.989Z (4 months ago)
- Language: C++
- Homepage:
- Size: 324 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Binary-Space-Partition-
We need to partition the space using binary space partition tree (BSP tree) unless a specific condition is specified.We have an Euclidean space ( x-axis is (0,100) and y-axis is (0,100)) in which n points are ramdomly generated
e.g. n1=(4,5)
n2= (10,12)
.
.
and so on n20=(45,10)We need to partition the space using binary space partition tree (BSP tree)
say after first partition, there are 8 points in the first partition and 12 points in the second partition
Once we have seperated the points of each partition we need to check following condition
For partition one
center_x = sum(x-coordinates of all the points of first partition)/number of points in the partition
center_y = sum(y-coordinates of all the points of first partition)/number of points in the partitionnow we have the center of first partition i.e., (center_x, center_y)
Next, we need to check whether the Euclidean distance of each point of first partition from its center is less than or equal to the Range (R)
if the above condition is true, we are not required to further partition the first partition.otherwise, we will again partition the first partition using BSP.
say the number of points in first partition of the initial first partition is 3 and
the number of points in second partition of the initial first partition is 5, (i.e., first of first (3) + second of first (5) = 8))
Then again we will check whether all the points of each partition are located with in R distance to their respective centers.This procedure must be followed until all the points of each partition are located with in R distance to their respective centers.
In the Output
1. It asks the user for R.
2. Then X and Y coordinates for the space
3. Then Number of Elements (N)
4. Then all the random points created are displayed.
5. finally the main result is displayed i.e. partition Number ,no. of points in that partition , points with its id