Difference between revisions of "COS"
Jump to navigation
Jump to search
(8 intermediate revisions by 2 users not shown) | |||
Line 10: | Line 10: | ||
</table> | </table> | ||
<h1>COS</h1> | <h1>COS</h1> | ||
− | <p>COS(f) returns the cosine of f where f is in | + | <p>COS(f) returns the cosine of f where f is in Degrees.</p> |
<p></p> | <p></p> | ||
<pre style='width:50ex'> | <pre style='width:50ex'> | ||
− | COS(3.14159/3) -> 0 | + | COS(3.14159/3) -> -1.0 |
</pre> | </pre> | ||
<div class='ht'> | <div class='ht'> | ||
Line 24: | Line 24: | ||
INSERT INTO angle VALUES (1,0.7853); | INSERT INTO angle VALUES (1,0.7853); | ||
INSERT INTO angle VALUES (2,0.5235); | INSERT INTO angle VALUES (2,0.5235); | ||
− | INSERT INTO angle VALUES (3, | + | INSERT INTO angle VALUES (3,1.0471); |
</source> | </source> | ||
− | In this example you return the cosine of each of the angles. | + | In this example you return the cosine of each of the angles. |
+ | <source lang='sql' class='def e-oracle'> | ||
+ | SELECT id, angle, COS(angle) | ||
+ | FROM scott.angle | ||
+ | </source> | ||
<source lang='sql' class='def'> | <source lang='sql' class='def'> | ||
− | SELECT id | + | SELECT id, angle, COS(angle) |
− | + | FROM angle | |
− | |||
</source> | </source> | ||
</div> | </div> | ||
Line 37: | Line 40: | ||
<ul> | <ul> | ||
<li>[[SIN |SIN function]]</li> | <li>[[SIN |SIN function]]</li> | ||
− | <li>[[TAN | + | <li>[[TAN |TAN function]]</li> |
− | |||
</ul> | </ul> | ||
+ | |||
+ | {{Languages}} |
Latest revision as of 07:20, 18 April 2014
COS(a) | ||
---|---|---|
Engine | OK | Alternative |
ingres | Yes | |
mysql | Yes | |
oracle | Yes | |
postgres | Yes | |
sqlserver | Yes |
COS
COS(f) returns the cosine of f where f is in Degrees.
COS(3.14159/3) -> -1.0
schema:scott
DROP TABLE angle
CREATE TABLE angle(
id INTEGER,
angle FLOAT);
INSERT INTO angle VALUES (0,1);
INSERT INTO angle VALUES (1,0.7853);
INSERT INTO angle VALUES (2,0.5235);
INSERT INTO angle VALUES (3,1.0471);
In this example you return the cosine of each of the angles.
SELECT id, angle, COS(angle)
FROM scott.angle
SELECT id, angle, COS(angle)
FROM angle
See also
Language: | English • Deutsch |
---|