Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

JavaScript/Algorithm: In a shape(rectangle or square) with width n and length m, We want to know how many shapes there are with width and length a and b. We also want to know the remaining forms.

License

Notifications You must be signed in to change notification settings

BaseMax/ShapesAlgorithm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

53 Commits

Repository files navigation

Shapes Algorithm JS

Demo: https://basemax.github.io/ShapesAlgorithm/demo.html

Shapes Algorithm

About the algorithm

In a shape(rectangle or square) with width n and length m, We want to know how many shapes there are with width and length a and b. We also want to know the remaining forms. For example, in the figure below, whose width and length are 10cm x 10cm, a shape with a width and length of 3 x 3 will be output as below:

image

  • 9 items 3cm in 3cm (called G1)
  • 3 items 1cm in 3cm (called G2)
  • 3 items 3cm in 1cm (called G3)
  • And a 1cm in 1cm item (called G4)

More about the problem: https://math.stackexchange.com/questions/4533522/how-to-calculate-number-of-shapes-inside-a-shape/4533998#4533998

About

JavaScript/Algorithm: In a shape(rectangle or square) with width n and length m, We want to know how many shapes there are with width and length a and b. We also want to know the remaining forms.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

AltStyle によって変換されたページ (->オリジナル) /