Jump to content

File:Slope quadrant comma.svg

Page contents not supported in other languages.
This is a file from the Wikimedia Commons
From Wikipedia, the free encyclopedia

Original file (SVG file, nominally 540 × 540 pixels, file size: 263 KB)

Summary

Description
English: Quadrant showing slope as a fraction, percentage and in degrees.
Date
Source Own work based on: Pente-Slope --Degres-Ratio V1.jpg
Author M. W. Toews
Other versions Slope quadrant.svg
SVG development
InfoField
 
The SVG code is valid.
 
This chart was created with R.
Source code
InfoField

R code

library(MASS)
cosd <- function(deg) cos(deg * pi / 180)
sind <- function(deg) sin(deg * pi / 180)

options(OutDec= ",")

svg("slope_quadrant_comma.svg", width=6, height=6)

par(pty="s", mar=c(1, 1, 1, 1), xaxs="i", yaxs="i", xpd=TRUE)
frame()
plot.window(c(0, 1.2), c(0, 1.2))

# Minor ticks
deg1 <- seq(0, 90, 1)
deg1 <- deg1[deg1 %% 5 != 0]
segments(0.95 * cosd(deg1), 0.95 * sind(deg1), cosd(deg1), sind(deg1), lwd=0.8)

# Semi-major ticks
deg5 <- seq(0, 90, 5)
deg5 <- deg5[deg5 %% 10 != 0]
segments(0, 0, 0.8 * cosd(deg5), 0.8 * sind(deg5), lwd=1)
segments(0.92 * cosd(deg5), 0.92 * sind(deg5), cosd(deg5), sind(deg5), lwd=1)

# Major ticks
deg10 <- seq(0, 90, 10)
segments(0, 0, 0.8 * cosd(deg10), 0.8 * sind(deg10), lwd=1.6)
segments(0.9 * cosd(deg10), 0.9 * sind(deg10), cosd(deg10), sind(deg10), lwd=1.6)

# Inside labels
for (deg in deg10) {
  text(0.89 * cosd(deg), 0.89 * sind(deg), paste0(deg, intToUtf8(176)),
       adj=c(0.5, 1), srt=deg - 90)
  pct <- tan(deg * pi / 180) * 100
  if (pct == 0)
    fpct <- "0%"
  else if (pct > 1e16)
    fpct <- expression(infinity ~ '%')
  else
    fpct <- format(pct, digits=3)
  text(0.85 * cosd(deg), 0.85 * sind(deg), fpct,
       adj=c(0.5, 1), srt=deg - 90, font=3, col="darkred", cex=0.9)
}

# Outside ticks
fr.lab <- c(0, 1/10, 1/5, 3/10, 2/5, 1/2, 3/5, 3/4, 1, 5/4, 3/2, 2, 3, 5, 10, Inf)
fr.tick <- sort(unique(c(fr.lab, c(seq(5, 95, 5), seq(100, 150, 10), 400) / 100)))
fr.rad <- atan(fr.tick)
s5 <- replace(zapsmall((fr.tick * 100) %% 10) == 5, is.infinite(fr.tick), FALSE)
segments(cos(fr.rad[s5]), sin(fr.rad[s5]),
         1.04 * cos(fr.rad[s5]), 1.04 * sin(fr.rad[s5]),
         lwd=1, col="darkred")
segments(cos(fr.rad[!s5]), sin(fr.rad[!s5]),
         1.07 * cos(fr.rad[!s5]), 1.07 * sin(fr.rad[!s5]),
         lwd=1.6, col="darkred")

# Outside labels
for (fv in fr.lab) {
  rad <- atan(fv)
  deg <- rad * 180 / pi
  fdeg <- paste0(format(deg, digits=3), intToUtf8(176))
  frac <- as.character(fractions(fv))
  pct <- fv * 100
  if (fv == 0) {
    frac <- "0/x"
    pct <- "0%"
  } else if (is.infinite(fv)) {
    frac <- paste0(intToUtf8(8734), "/1")
    pct <- expression(infinity ~ '%')
  } else if (!(grepl("/", frac))) {
    frac <- paste0(frac, "/1")
  }
  text(1.1 * cos(rad), 1.1 * sin(rad), pct,
       adj=c(0.5, 0), srt=deg - 90, font=3, col="darkred", cex=1)
  text(1.15 * cos(rad), 1.15 * sin(rad), fdeg,
       adj=c(0.5, 0), srt=deg - 90, cex=0.9)
  text(1.2 * cos(rad), 1.2 * sin(rad), frac,
       adj=c(0.5, 0), srt=deg - 90, font=3, col="purple4", cex=0.9)
  
}

# Arc
deg1 <- seq(0, 90, 1)
lines(cosd(deg1), sind(deg1), lwd=1.6)

dev.off()

Licensing

w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.

Captions

Add a one-line explanation of what this file represents

Items portrayed in this file

depicts

13 November 2017

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current00:50, 13 November 2017Thumbnail for version as of 00:50, 13 November 2017540 × 540 (263 KB)Mwtoews{{Information |Description ={{en|1=Quadrant showing slope as a fraction, percentage and in degrees.}} |Source ={{Own}}, but based on File:Pente-Slope --Degres-Ratio V1.jpg |Author =M. W. Toews |Date =2...
No pages on the English Wikipedia use this file (pages on other projects are not listed).

Global file usage

The following other wikis use this file:

Metadata