Skip to content

This code calculates the coordinates of a given value in the inner spiral algorithm, with the center point at (0,0).

License

Notifications You must be signed in to change notification settings

whiter007/inner-spiral-algorithm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

inner-spiral-algorithm

This code calculates the coordinates of a given value in the inner spiral algorithm, with the center point at (0,0).

Illustration in table

图片

在这段代码中,我们将向量的坐标系定义为:

Z轴:向上为正半轴,向下为负半轴

X轴:向左为正半轴,向右为负半轴

输出坐标为 ( x , z )

input and output

input range

1 ~ 2147483647

output range

(0,0) ~ (-18536,23170)

Output screenshot

图片

About

This code calculates the coordinates of a given value in the inner spiral algorithm, with the center point at (0,0).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages