A set of useful scaling functions
A set of useful scaling functions
(euclidean-distance vec-a vec-b)
Will calculate Euclidean distance between two vectors of the same size.
Will calculate Euclidean distance between two vectors of the same size.
(font-size-in-a-tag-cloud min-font-size
max-font-size
items-in-the-biggest-tag
items)
Will linearly calculate font size of a tag in a tag cloud. Courtesy of: https://stackoverflow.com/a/3717340/3362518
Will linearly calculate font size of a tag in a tag cloud. Courtesy of: https://stackoverflow.com/a/3717340/3362518
(golden-ratio size step)
Will calculate golden ratio
Will calculate golden ratio
(haversine lat-1 lng-1 lat-2 lng-2)
(haversine lat-1 lng-1 lat-2 lng-2 radius)
Will calculate Haversine distance between two points on a shphere Correctness checked at: https://www.vcalc.com/wiki/vCalc/Haversine+-+Distance
Will calculate Haversine distance between two points on a shphere Correctness checked at: https://www.vcalc.com/wiki/vCalc/Haversine+-+Distance
(lat-lon->tile-x-y lat-deg lon-deg zoom)
Will calculate X and Y coordinates of a map tile, when given latitude longitude and a zoom level. Which you can check on OpenStreetMap: https://c.tile.openstreetmap.org/18/161421/97171.png
Will calculate X and Y coordinates of a map tile, when given latitude longitude and a zoom level. Which you can check on OpenStreetMap: https://c.tile.openstreetmap.org/18/161421/97171.png
(log-scale x1 x2 y1 y2 x)
Will calculate log scaling (mapping) from one metric into another
Will calculate log scaling (mapping) from one metric into another
(log-scale-round x1 x2 y1 y2 x)
Will calculate rounded log scale
Will calculate rounded log scale
(paginate current last-item)
Will create pagination based on current page and the amount of pages as input
Will create pagination based on current page and the amount of pages as input
(scale A B C D X)
Will calculate linear scaling (mapping) from one metric into
Will calculate linear scaling (mapping) from one metric into
(tag-font-log-normalized items-in-the-biggest-tag items)
Will non linearly calculate font size of a tag in a tag cloud
Will non linearly calculate font size of a tag in a tag cloud
(x-y->tile-lat-lon xtile ytile zoom)
Will calculate latitude and longitude coordinates of a map tile, when given tile X Y and a zoom level. You can check example on OpenStreetMap: https://www.openstreetmap.org/#map=18/42.1440/41.6780
Will calculate latitude and longitude coordinates of a map tile, when given tile X Y and a zoom level. You can check example on OpenStreetMap: https://www.openstreetmap.org/#map=18/42.1440/41.6780
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close