Find the radius of a sphere where n points fit in with dist?

   982   3   1
User Avatar
Member
3 posts
Joined: 8月 2021
Offline
Hi I’m SlowlyLearningMath_houGuy, (bear with me, I am slow, but I am moving)

How to find the radius of a sphere that x amount of points fit in at a certain point distance?

(Kindof the inverse of the pointsfromvolume sop, knowing only point distance and the number of points (in VEX))

Thanks in advance.
User Avatar
Member
2038 posts
Joined: 9月 2015
Offline
There's many ways of doing that. Perhaps you could provide a hip file with a working example that supports your end goal.
Thereby you will get a suggested solution that fits well with your approach/context.
User Avatar
Member
3 posts
Joined: 8月 2021
Offline
Check out the POP section. Made some notes for it. :-)

I would need to know the radius of a sphere to which a pointsfromvolume would produce x amount of points at with a certain point distance (0.2 in my case, because of the POP Interact values).

Hope that makes sense.
Edited by SlowlyLearningMath_houGuy - 2022年11月27日 16:51:58

Attachments:
constrict_and_bound_pop_by_sphere_with_variable,_adaptable_size.hiplc (510.0 KB)

User Avatar
Member
475 posts
Joined: 7月 2005
Offline
Hi,
not sure if I understood you correctly, but if you are searching for radius, where a specific ratio of fits in.
For example if you have 100 points and the ratio is 0.25 you are searching a radius, where 25 points are in the sphere with this radius.
You can try bisection method for this. Here is an example, for a 2D scatter plot (it just better for visualization it also works for 3d). Also there is usually not only one radius, but a range with minimum and maximum radius, where this condition holds.

Attachments:
find_radius_ratio.hipnc (121.8 KB)

  • Quick Links