Yin and yang: Difference between revisions

Content added Content deleted
m (→‎{{header|Rust}}: inserted a img)
Line 4,782: Line 4,782:


=={{header|Rust}}==
=={{header|Rust}}==
[[File:YinYang rust.svg]]
Creates a [http://gist.githubusercontent.com/vvshard/b11ee56adbb21967e43fb606cba19e56/raw/yin_yang.svg '''yin_yang.svg file''']. Rust version 1.58.0 or higher required

'''[dependencies]'''<br>
'''[dependencies]'''<br>
svg = "0.10.0"
svg = "0.10.0"
Line 4,791: Line 4,791:
let doc = svg::Document::new()
let doc = svg::Document::new()
.add(yin_yang(15.0, 1.0).set("transform", "translate(20,20)"))
.add(yin_yang(15.0, 1.0).set("transform", "translate(20,20)"))
.add(yin_yang(6.0, 1.0).set("transform", "translate(50,11)"));
.add(yin_yang(6.0, 0.7).set("transform", "translate(50,11)"));
svg::save("yin_yang.svg", &doc).unwrap();
svg::save("YinYang_rust.svg", &doc.set("width", 57)).unwrap();
}
}
/// th - the thickness of the outline around yang
/// th - the thickness of the outline around yang