Learn
Practice
Newsletter
Resources
F
Toggle theme
0
F
Toggle theme
0
Toggle menu
← Back to All Animations
Valid Square
Bookmark
Input
Valid square
Rotated valid square
Not a square
All same point
Custom
p1
=
[0, 0]
,
p2
=
[1, 0]
,
p3
=
[1, 1]
,
p4
=
[0, 1]
0
1
0
1
p1(0,0)
p2(1,0)
p3(1,1)
p4(0,1)
algo
master
.
io
Step:
Start: Given 4 points, determine if they form a valid square
Variable
Value
side
-
diag
-
isValid
-
p1
"[0,0]"
Variable
Value
p2
"[1,0]"
p3
"[1,1]"
p4
"[0,1]"
0 / 10
Input
Valid square
Rotated valid square
Not a square
All same point
Custom
p1
=
[0, 0]
,
p2
=
[1, 0]
,
p3
=
[1, 1]
,
p4
=
[0, 1]
0 / 10
0
1
0
1
p1(0,0)
p2(1,0)
p3(1,1)
p4(0,1)
algo
master
.
io
Step:
Start: Given 4 points, determine if they form a valid square
Visualization
Variables