Created
September 21, 2012 16:45
-
-
Save benevolent0505/3762564 to your computer and use it in GitHub Desktop.
「A Tour of Go」でGo言語を学ぶ(~#10) ref: http://qiita.com/items/a5b514b289997b50a8bb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-1 1.2246467991473515e-16 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func parameter(radius,angle float64) (float64,float64) { | |
x := radius * math.Cos(angle) | |
y := radius * math.Sin(angle) | |
return x,y | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"math" | |
) | |
func parameter(radius,angle float64) (x,y float64) { | |
x = radius * math.Cos(angle) | |
y = radius * math.Sin(angle) | |
return | |
} | |
func main() { | |
fmt.Println(parameter(1.0,math.Pi)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment