Template talk:Convert

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search

Frequently asked questions (FAQ)
Q: When using {{convert}} why does the answer sometimes seem somewhat off?
A: This template takes into account the precision of the supplied value and generally rounds the output to the same level of precision. If you need to change from the default output precision, see rounding.
Q: What are all the possible units (kg, lb, m, cm, ft, in, °C, °F, km, mi, nmi, mph, km/h, and so on)?
A: See units.
Q: I've been using Convert for some time and am pretty comfortable with its basic features. Does it have other features which it would be worth my while to learn about?
A: Almost certainly. Start with Help:Convert.
For more, see the FAQ.
... in conception
... and in reality

Proposal: Add angular units[edit]

Since {{convert}} supports almost every conceivable unit (except poorly defined historical/folk units), it seems puzzling that it does not support angular units. I propose to add the following units:

Code Symbol Name Link Comment
° ° degree Degree (angle) The buttons for entering ° ′ ″ are right under the text input area.
arcminute Minute of arc
arcsecond Second of arc
mas mas milliarcsecond Milliarcsecond
µas µas microarcsecond Microarcsecond
radian rad radian Radian rad is already taken by radiation unit rad.
mradian mrad milliradian Milliradian
grad grad gradian Gradian grad is non-standard, but instantly recognizable.
turn turn turn Turn (angle)
Rotational speed:
rpm rpm revolution per minute Revolutions per minute Default output: Hz.
radian/s rad/s radian per second Radian per second Default output: Hz.
Aliases:
arcmin arcmin arcminute Minute of arc
arcsec arcsec arcsecond Second of arc
gon gon gradian Gradian gon is specified in ISO 31-1.
r r turn Turn (angle) r is specified in IEEE 260.1:2004 and ISO 80000-3:2006.
MOA MOA minute of angle Minute of arc Used in weapons aiming. Default output: milr.
milr mil milliradian Milliradian Used in weapons aiming. Default output: MOA.
mil is already taken by thousandth of an inch.

The multiple units feature of {{convert}} can be used in input:

  • {{convert|2|°|47|′|19|″|radian|abbr=on}} → 2° 47′ 19″ (0.048670 rad)
  • {{convert|47|′|19|″|mradian|abbr=on}} → 47′ 19″ (13.764 mrad)

And output:

  • {{convert|0.50|mradian|′″}} → 0.50 milliradian (1′ 43″)
  • {{convert|0.50|mradian|′ ″}} → 0.50 milliradian (1.72′; 103″)

There are other angular units that may be added in the future, if a need arises:

  • Plane angle: compass point, binary degree (=binary radian, brad), diameter part, milliturn, microturn, NATO mil, Warsaw Pact mil (=Soviet mil, Russian mil, m.d.u.), Swedish streck;
  • Rotational speed: cycle per second (=c.p.s., c/s, cycle), kilocycle per second (=kilocycle, kc), megacycle (=Mc), kilomegacycle (=kMc);
  • Solid angle: steradian, square degree, spat.

— UnladenSwallow (talk) 05:16, 21 April 2020 (UTC)

Yes we need solid angle. It seems that the non-SI square degree is used in many places, which you can find as links to that page. The one I ran into this for is gravitational wave, but also at least Wide_Angle_Search_for_Planets, but maybe all the links to square degree. Gah4 (talk) 15:22, 8 July 2020 (UTC)
Any new unit needs a couple of examples of articles where convert would be useful. That is, what wikitext in an article would be replaced with a convert? Previous discussions (which I haven't looked at recently) are at September 2015 and February 2018 and October 2019. Convert already supports a hertz unit but it is rather unusual (Hz is a unit of length)—see March 2015. Johnuniq (talk) 06:52, 21 April 2020 (UTC)
{Slightly off-topic} Can I just pick you up on one point: Hz isn't a unit of length. If c is a velocity, then Hz is a unit of reciprocal time; If c is dimensionless, then Hz is a unit of reciprocal length. I understand that {convert} can be set up to make conversions from wavelength (length) to frequency (reciprocal time), but it's a mistake to assert that {convert} only converts quantities that have the same dimensions. As an example, it has been converting fuel consumption for years:
  • {{cvt|5|L/100 km}} → 5 L/100 km (56 mpg‑imp; 47 mpg‑US)
  • {{cvt|10|L/100 km}} → 10 L/100 km (28 mpg‑imp; 24 mpg‑US)
where the input unit has dimensions of volume/length (area) and the output units have dimensions of length/volume (reciprocal area!). --RexxS (talk) 19:19, 21 April 2020 (UTC)
@Johnuniq:
Article Example
Pendulum In the case of a typical grandfather clock whose pendulum has a swing of 6° and thus an amplitude of 3° (0.05 radians), the difference between the true period and the small angle approximation (1) amounts to about 15 seconds per day.
Angular diameter The table shows that the angular diameter of Sun, when seen from Earth is approximately 32′ (1920″ or 0.53°), as illustrated above.
To put this in perspective, the full Moon as viewed from Earth is about ​12°, or 30′ (or 1800″).
Globe Usually a globe is mounted so that its spin axis is 23.5° (0.41 rad) from vertical, which is the angle the Earth's spin axis deviates from perpendicular to the plane of its orbit.
Telescopic sight Some proprietary rails also offer the possibility to tilt the scope up to 1° (60 moa; 17.5 mrad) to the left or right.
Equation of time The numerical values written here result from using the orbital parameter values, e = 0.016709, ε = 23.4393° = 0.409093 radians, and λp = 282.9381° = 4.938201 radians that correspond to the epoch 1 January 2000 at 12 noon UT1.
Steradian This angle corresponds to the plane aperture angle of 2θ ≈ 1.144 rad or 65.54°.
Faraday effect By placing a rod of this material in a strong magnetic field, Faraday rotation angles of over 0.78 rad (45°) can be achieved.
JavaScript syntax
Math.acos(Math.SQRT1_2) 0.78540 rad. = 45° Arccosine
Math.asin(Math.SQRT1_2) 0.78540 rad. = 45° Arcsine
Math.atan(1) 0.78540 rad. = 45° Half circle arctangent (-π/2 to +π/2)
Math.atan2(-3.7, -3.7) -2.3562 rad. = -135° Whole circle arctangent (-π to +π)
Young–Laplace equation For a water-filled glass tube in air at sea level:
γ = 0.0728 J/m2 at 20 °C θ = 20° (0.35 rad)
ρ = 1000 kg/m3 g = 9.8 m/s2
Small-angle approximation The angles at which the relative error exceeds 1% are as follows:
  • tan θθ at about 0.176 radians (10°).
  • sin θθ at about 0.244 radians (14°).
  • cos θ ≈ 1 − θ2/2 at about 0.664 radians (38°).
— UnladenSwallow (talk) 11:02, 23 April 2020 (UTC)
Arcsec is commonly taken to be arcsecant. See Inverse_trigonometric_functions. Martin of Sheffield (talk) 19:34, 23 April 2020 (UTC)
@Martin of Sheffield: Not in astronomy:
Article Example
Exoplanet The data was obtained on 16 March 2003 with NACO on the VLT, using a 1.4 arcsec occulting mask on top of AB Pictoris.
Alpha Centauri Viewed from Earth, the apparent orbit of A and B means that their separation and position angle (PA) are in continuous change throughout their projected orbit. Observed stellar positions in 2019 are separated by 4.92 arcsec through the PA of 337.1°, increasing to 5.49 arcsec through 345.3° in 2020. The closest recent approach was in February 2016, at 4.0 arcsec through the PA of 300°. The observed maximum separation of these stars is about 22 arcsec, while the minimum distance is 1.7 arcsec.
Their apparent angular separation varies over about 80 years between 2 and 22 arcsec (the naked eye has a resolution of 60 arcsec), but through much of the orbit, both are easily resolved in binoculars or small telescopes.
Quasar Image is 60 arcsec on a side.
New Horizons The instrument is equipped with a 1024×1024 pixel by 12-bits-per-pixel monochromatic CCD imager giving a resolution of 5 μrad (~1 arcsec).
Parallax The nearest star to the Sun (and thus the star with the largest parallax), Proxima Centauri, has a parallax of 0.7687 ± 0.0003 arcsec.
Cosmic distance ladder It is, more precisely, the galaxy's angular diameter out to the surface brightness level of 20.75 B-mag arcsec−2.
Panspermia The probability of hitting the target zone can be calculated from where A(target) is the cross-section of the target area, dy is the positional uncertainty at arrival; a – constant (depending on units), r(target) is the radius of the target area; v the velocity of the probe; (tp) the targeting precision (arcsec/yr); and d the distance to the target, guided by high-resolution astrometry of 1×10−5 arcsec/yr (all units in SIU).
Astrometry In the 16th century, Tycho Brahe used improved instruments, including large mural instruments, to measure star positions more accurately than previously, with a precision of 15–35 arcsec.
He made the first measurement of stellar parallax: 0.3 arcsec for the binary star 61 Cygni.
During the past 50 years, 7,435 Schmidt camera plates were used to complete several sky surveys that make the data in USNO-B1.0 accurate to within 0.2 arcsec.
Proper motion Of the stars visible to the naked eye (by convention, limiting visual magnitude of 6.0), 61 Cygni A (magnitude V=5.20) has the highest proper motion at 5.281 arcsec/a, although Groombridge 1830 (magnitude V=6.42), proper motion 7.058 arcsec/a, might be visible for an observer with exceptionally keen vision.

A proper motion of 1 arcsec per year at a distance of 1 light-year corresponds to a relative transverse speed of 1.45 km/s.

Arcsecant is not a measurement unit anyway, so arcsec will be unambiguous when used with {{convert}}. — UnladenSwallow (talk) 11:38, 24 April 2020 (UTC)

Deadweight tonnage[edit]

Do the convert templates have any help for converting Deadweight tonnage into internationally recognized units of weight, or mass? tons and tonnes short tons and long tons plus others? are legend. I did a search and couldn't find anything. Cheers. N2e (talk) 04:09, 29 July 2020 (UTC)

There are DWton and DWtonne. There are too many units to list on any reasonable page. The full list is at Module:Convert/documentation/conversion data#Mass. Johnuniq (talk) 07:02, 29 July 2020 (UTC)
Thanks, Johnuniq! Will give it a shot with those. N2e (talk) 08:33, 29 July 2020 (UTC)

Mach conversions are off[edit]

See Boom Overture. This template is translating Mach 2.2 as 2,300 km/h or 1,300 kn, the actual values (precision 2 s.f.) ought to be 2,700 km/h or 1,500 kn. Could someone please fix this?--Newbiepedian (talk · C · X! · L) 15:44, 2 August 2020 (UTC)

Newbiepedian, the template is showing the converted speeds at altitude (in this case, I believe 60,000 ft). 2700 km/h would be the speed at ground level, which the aircraft obviously would not be flying when at Mach speeds. Unfortunately I can't find where using Mach in the template is really documented anywhere. Huntster (t @ c) 16:27, 2 August 2020 (UTC)
Search for Mach in Module:Convert. The unit that is supplied after the Mach is the altitude. So:
  • {{convert|2.2|Mach|0|kn km/h|-2}} gives Mach 2.2 (1,500 kn; 2,700 km/h)
  • {{convert|2.2|Mach|60000|kn km/h|-2}} gives Mach 2.2 (1,300 kn; 2,300 km/h)
-- WOSlinker (talk) 21:03, 2 August 2020 (UTC)
Hmm, I can't find where Mach was ever documented. Meanwhile, as explained above, a number following Mach as the input unit is the altitude in feet. There is no way to specify an altitude if using Mach as the output unit. Altitude is relevant because Mach number is relative to the speed of sound which varies with atmospheric conditions, mainly pressure which varies with altitude. Johnuniq (talk) 23:36, 2 August 2020 (UTC)
I remember Mach has an @-parameter, iow it is tabular/3D/third-dependence. -DePiep (talk) 00:26, 3 August 2020 (UTC)

g/PS/h fuel efficiency[edit]

Ikarus 55#Technical description
190 g·PS<sup>−1</sup>·h<sup>−1</sup> (258 g·kW<sup>−1</sup>·h<sup>−1</sup>)
190 g·PS−1·h−1 (258 g·kW−1·h−1)
How was this calculated and how can this be done with convert? Peter Horn User talk 00:22, 4 August 2020 (UTC)

Johannes Maximilian wrote Ikarus 55 in May 2019 and may like to comment. I'm not familiar with measuring fuel consumption in that manner and the −1 stuff would be a puzzle for many readers, although obvious for anyone with a basic science education. Here is the article text and the closest convert can do (cvt = convert with abbr=on):
  • 190&nbsp;g·PS<sup>&minus;1</sup>·h<sup>&minus;1</sup> (258&nbsp;g·kW<sup>&minus;1</sup>·h<sup>&minus;1</sup>) → 190 g·PS−1·h−1 (258 g·kW−1·h−1)
  • {{cvt|190|g/PS/h|g/kW/h}} → 190 g/PS/h (260 g/kW/h)
  • {{cvt|190|g/PS/h|g/kW/h|0}} → 190 g/PS/h (258 g/kW/h)
Johnuniq (talk) 00:51, 4 August 2020 (UTC)
Different fuels have different densities, which is why in internal combustion engines, a "mass per energy" figure is used. For example, if an Akroyd engine has a 9 litre fuel consumption (and we're using Diesel fuel since it's cheaper), it has a higher(!) fuel consumption than an Otto engine that burns 10 litres of petrol: 9 litres of Diesel fuel is approx. 7.65 kg, whereas 10 litres of petrol is approx. 7.5 kg. Energy is the product of power and time, so if we're reversing this, we can have mass per power output per time. So for example, if a 100 kW engine runs for one hour at full load, and it has a rated fuel consumption of 200 g/kW/h, it burns 200×100 g = 20 kg of fuel. If one kilogramme of fuel holds 40 MJ of energy, 100 kWh of motion energy require 800 MJ or 222 kWh of chemical energy, so the engine's efficiency is 45 %. Now back in the 1960s, engineers used g/PS/h, since engines were often rated in PS. That is wht g/PS/h exists. Technically, g/kWh is incorrect, because it implies (g/kW)h "grammes per kilowatt times hour. What we say and mean is "grammes per kilowatthour, which would be g/(kWh), or g/kW/h, or g·kW−1·h−1. A common mistake with conversions is multiplying g/PS/h with 0.73549875 instead of dividing it by that figure for converting to g/kW/h. So 150 g/PS/h is actually 204 g/kW/h and not 110 g/kW/h. I hope I have convered all questions you might have had. Best regards, --Johannes (Talk) (Contribs) (Articles) 01:30, 4 August 2020 (UTC)

Better wikilink needed[edit]

I notice at 2020 Beirut explosion that in an instance of this template, {{convert|1.2|ktonTNT|TJ|sigfig=2|lk=on}}, which renders as 1.2 kilotons of TNT (5.0 TJ), the link over TJ goes just to Joule, rather than to Terajoule, which redirects to Joule#Terajoule. I think it would be more useful for readers for the link to go to terajoule, since they may not know that the T stands for tera. Could a more specific link be adopted here for terajoules and other multiples of joules/other units as appropriate? {{u|Sdkb}}talk 02:45, 17 August 2020 (UTC)

Thanks, I added terajoule and gigajoule as links (megajoule and kilojoule already existed). That will go live when I next update the modules, which I'd better do in the next week or two. Johnuniq (talk) 03:02, 17 August 2020 (UTC)