{"id":622,"date":"2015-06-30T14:47:45","date_gmt":"2015-06-30T12:47:45","guid":{"rendered":"http:\/\/www.valcon.it\/python\/?p=622"},"modified":"2023-01-15T20:00:28","modified_gmt":"2023-01-15T19:00:28","slug":"complex","status":"publish","type":"post","link":"https:\/\/www.valcon.it\/python\/complex\/","title":{"rendered":"complex()"},"content":{"rendered":"\n<p>I numeri complessi fanno parte dei tipi di dato predefiniti!<br>Un valore numerico seguito da <strong>j<\/strong> oppure <strong>J<\/strong> viene interpretato come la parte immaginaria di un numero complesso.<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><tbody><tr><td><code>4<strong>j<\/strong><\/code><\/td><td>Restituisce il numero complesso 0+4j<\/td><\/tr><tr><td><code>3+4<strong>j<\/strong><\/code><\/td><td>Restituisce il numero complesso 3+4j<\/td><\/tr><tr><td><code><strong>complex<\/strong>(3)<\/code><\/td><td>Restituisce il numero complesso 3+0j<\/td><\/tr><tr><td><code><strong>complex<\/strong>(x)<\/code><\/td><td><\/td><\/tr><tr><td><code><strong>complex<\/strong>(3, -4)<\/code><\/td><td>Restituisce il numero complesso 3-4j<\/td><\/tr><tr><td><code><strong>complex<\/strong>(x, y)<\/code> <\/td><td><\/td><\/tr><tr><td><code><strong>complex<\/strong>(\"3-4j\")<\/code><\/td><td>Restituisce il numero complesso 3-4j<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Operatori<\/h2>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><tbody><tr><td><code>c1 <strong>+<\/strong> c2<\/code><\/td><td>complex<\/td><td>&#8230;<\/td><\/tr><tr><td><code>c1 <strong>-<\/strong> c2<\/code><\/td><td>complex<\/td><td>&#8230;<\/td><\/tr><tr><td><code>c1 <strong>*<\/strong> c2<\/code><\/td><td>complex<\/td><td>&#8230;<\/td><\/tr><tr><td><code>c1 <strong>\/<\/strong> c2<\/code><\/td><td>complex<\/td><td>&#8230;<\/td><\/tr><tr><td><code>c1 <strong>**<\/strong> c2<\/code><\/td><td>complex<\/td><td>Restituisce l&#8217;elevamento a potenza<\/td><\/tr><tr><td><code>c1 <strong>==<\/strong> c2<\/code><\/td><td>bool<\/td><td>c1 \u00e8 uguale a c2?<\/td><\/tr><tr><td><code>c1 <strong>!=<\/strong> c2<\/code><\/td><td>bool<\/td><td>c1 NON \u00e8 uguale a c2?<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Funzioni \/ metodi \/ propriet\u00e0<\/h2>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><tbody><tr><td><code><strong>abs<\/strong>(c)<\/code><\/td><td>float<\/td><td>Restituisce il modulo del numero complesso<\/td><\/tr><tr><td><code>c.<strong>conjugate<\/strong>()<\/code><\/td><td>complex<\/td><td>Restituisce il complesso coniugato di c<\/td><\/tr><tr><td><code>c.<strong>real<\/strong><\/code><\/td><td>float<\/td><td>Restituisce la parte reale di c<\/td><\/tr><tr><td><code>c.<strong>imag<\/strong><\/code><\/td><td>float<\/td><td>Restituisce la parte immaginaria di c<\/td><\/tr><tr><td><code><strong>pow<\/strong>(c1, c2)<\/code><\/td><td>complex<\/td><td>Restituisce l&#8217;elevamento a potenza<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Per operare con i numeri complessi esiste il modulo specifico <a href=\"https:\/\/www.valcon.it\/python\/cmath\/\">cmath<\/a>&nbsp;che fornisce anche le funzioni specifiche <strong>phase<\/strong>(), <strong>polar<\/strong>(),&nbsp;<strong>rect<\/strong>().<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I numeri complessi fanno parte dei tipi di dato predefiniti!Un valore numerico seguito da j oppure J viene interpretato come la parte immaginaria di un numero complesso. 4j Restituisce il numero complesso 0+4j 3+4j Restituisce il numero complesso 3+4j complex(3) Restituisce il numero complesso 3+0j complex(x) complex(3, -4) Restituisce il numero complesso 3-4j complex(x, y) &#8230; <a title=\"complex()\" class=\"read-more\" href=\"https:\/\/www.valcon.it\/python\/complex\/\" aria-label=\"Leggi di pi\u00f9 su complex()\">Leggi tutto<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[64],"tags":[],"_links":{"self":[{"href":"https:\/\/www.valcon.it\/python\/wp-json\/wp\/v2\/posts\/622"}],"collection":[{"href":"https:\/\/www.valcon.it\/python\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.valcon.it\/python\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.valcon.it\/python\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.valcon.it\/python\/wp-json\/wp\/v2\/comments?post=622"}],"version-history":[{"count":34,"href":"https:\/\/www.valcon.it\/python\/wp-json\/wp\/v2\/posts\/622\/revisions"}],"predecessor-version":[{"id":19030,"href":"https:\/\/www.valcon.it\/python\/wp-json\/wp\/v2\/posts\/622\/revisions\/19030"}],"wp:attachment":[{"href":"https:\/\/www.valcon.it\/python\/wp-json\/wp\/v2\/media?parent=622"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.valcon.it\/python\/wp-json\/wp\/v2\/categories?post=622"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.valcon.it\/python\/wp-json\/wp\/v2\/tags?post=622"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}