{"id":139,"date":"2011-03-10T22:15:38","date_gmt":"2011-03-11T04:15:38","guid":{"rendered":"http:\/\/bacliffexplorationsociety.org\/blog\/?p=139"},"modified":"2011-09-11T21:46:36","modified_gmt":"2011-09-12T02:46:36","slug":"fortran-cross-product","status":"publish","type":"post","link":"http:\/\/bacliffexplorationsociety.org\/blog\/2011\/03\/10\/fortran-cross-product\/","title":{"rendered":"Fortran Cross Product"},"content":{"rendered":"<p>In today&#8217;s lesson, we learn how to compute a vector cross product using Fortran.<\/p>\n<pre lang=\"fortran\">function cross(a,b) result(axb)\r\n\r\nimplicit none\r\ninteger,parameter :: wp=selected_real_kind(15, 307) !double precision\r\nreal(wp),dimension(3) :: axb\r\nreal(wp),dimension(3),intent(in) :: a\r\nreal(wp),dimension(3),intent(in) :: b \r\n\r\naxb(1) = a(2)*b(3) - a(3)*b(2)\r\naxb(2) = a(3)*b(1) - a(1)*b(3)\r\naxb(3) = a(1)*b(2) - a(2)*b(1)\r\n\r\nend function cross<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>In today&#8217;s lesson, we learn how to compute a vector cross product using Fortran. function cross(a,b) result(axb) implicit none integer,parameter :: wp=selected_real_kind(15, 307) !double precision real(wp),dimension(3) :: axb real(wp),dimension(3),intent(in) :: a real(wp),dimension(3),intent(in) :: b axb(1) = a(2)*b(3) &#8211; a(3)*b(2) axb(2) = a(3)*b(1) &#8211; a(1)*b(3) axb(3) = a(1)*b(2) &#8211; a(2)*b(1) end function cross<\/p>\n","protected":false},"author":16,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,10],"tags":[],"class_list":["post-139","post","type-post","status-publish","format-standard","hentry","category-fortran","category-programming"],"_links":{"self":[{"href":"http:\/\/bacliffexplorationsociety.org\/blog\/wp-json\/wp\/v2\/posts\/139","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bacliffexplorationsociety.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/bacliffexplorationsociety.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/bacliffexplorationsociety.org\/blog\/wp-json\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"http:\/\/bacliffexplorationsociety.org\/blog\/wp-json\/wp\/v2\/comments?post=139"}],"version-history":[{"count":15,"href":"http:\/\/bacliffexplorationsociety.org\/blog\/wp-json\/wp\/v2\/posts\/139\/revisions"}],"predecessor-version":[{"id":369,"href":"http:\/\/bacliffexplorationsociety.org\/blog\/wp-json\/wp\/v2\/posts\/139\/revisions\/369"}],"wp:attachment":[{"href":"http:\/\/bacliffexplorationsociety.org\/blog\/wp-json\/wp\/v2\/media?parent=139"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bacliffexplorationsociety.org\/blog\/wp-json\/wp\/v2\/categories?post=139"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bacliffexplorationsociety.org\/blog\/wp-json\/wp\/v2\/tags?post=139"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}