Damian Franco
asked on
Uniformly scaled a cuboid to fit inside another cuboid
Hello,
Lets say I have a cuboid V with any dimension (width, height, depth)
and I have another cuboid M again with any dimension (width, height, depth)
I have to scale down or up cuboid M to fit inside cuboid V
Right now I am finding the largest dimension of cuboid M and scaling it to fit the smallest dimension of cuboid V
VSize = [v.width, v.height, v.depth];
MSize = [m.width, m.height, m.depth];
largestMSize = calculateLargestSize(MSize )
smallestVSize = calculateSmallestSize(VSiz e);
scaleRatio = smallestVSize/largestMSize
I think this will guarantee cuboid M will fit inside cuboid V - BUT this is too extreme
Do you know of a way to calculate the correct scale for cuboid M to fit inside cuboid V?
Lets say I have a cuboid V with any dimension (width, height, depth)
and I have another cuboid M again with any dimension (width, height, depth)
I have to scale down or up cuboid M to fit inside cuboid V
Right now I am finding the largest dimension of cuboid M and scaling it to fit the smallest dimension of cuboid V
VSize = [v.width, v.height, v.depth];
MSize = [m.width, m.height, m.depth];
largestMSize = calculateLargestSize(MSize
smallestVSize = calculateSmallestSize(VSiz
scaleRatio = smallestVSize/largestMSize
I think this will guarantee cuboid M will fit inside cuboid V - BUT this is too extreme
Do you know of a way to calculate the correct scale for cuboid M to fit inside cuboid V?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks!
ASKER
How about if M is smaller than V? (ratio > 1)
How about if M is smaller than V AND one side of M is smaller than V but the other side of M is bigger than V?
What do we do?
THANKS!