MCPcopy Create free account
hub / github.com/cpmech/plotpy / draw_arc

Method draw_arc

src/canvas.rs:220–232  ·  view source on GitHub ↗

Draws arc (2D only) # Input `xc`, `yc` -- center coordinates `r` -- radius `ini_angle`, `fin_angle` -- arc angles in degrees (counter-clockwise)

(&mut self, xc: T, yc: T, r: T, ini_angle: T, fin_angle: T)

Source from the content-addressed store, hash-verified

218 /// * `r` -- radius
219 /// * `ini_angle`, `fin_angle` -- arc angles in degrees (counter-clockwise)
220 pub fn draw_arc<T>(&mut self, xc: T, yc: T, r: T, ini_angle: T, fin_angle: T)
221 where
222 T: std::fmt::Display + Num,
223 {
224 let opt = self.options_shared();
225 write!(
226 &mut self.buffer,
227 "p=pat.Arc(({},{}),2*{},2*{},theta1={},theta2={},angle=0{})\n\
228 plt.gca().add_patch(p)\n",
229 xc, yc, r, r, ini_angle, fin_angle, &opt
230 )
231 .unwrap();
232 }
233
234 /// Draws arrow (2D only)
235 ///

Callers 2

arc_worksFunction · 0.80
test_canvasFunction · 0.80

Calls 1

options_sharedMethod · 0.80

Tested by 2

arc_worksFunction · 0.64
test_canvasFunction · 0.64