File:Electromagnetic wave.svg

From Wikiversity
Jump to navigation Jump to search

Original file(SVG file, nominally 588 × 352 pixels, file size: 13 KB)

This is a file from the Wikimedia Commons. The description on its description page there is shown below.

Commons is a freely licensed media file repository. You can help.

Summary

Description Electromagnetic wave
Date
Source Own work
Author Lennart Kudling
Asymptote version
InfoField
 
The SVG code is valid.
 
This vector image was created with Asymptote.
Source code
InfoField

Asymptote code

import graph3;
import three;
import settings;
outformat="pdf";
settings.render = 0;
settings.prc = false;

usepackage("fourier");
defaultpen(font("T1","fut\textfamilyextension","m","n"));


size(300, 300);

// Set the camera.
currentprojection=perspective(16,-8,4);


void drawArrowX()
{
  real x0 = 12.8;
  real halfWidth = 0.02;
  real lineLength = 0.5;
  real arrowHalfWidth = 0.10;
  real arrowLength = 0.2;
  
  draw(
       (x0,-halfWidth,0)
    -- (x0 + lineLength,-halfWidth,0)
    -- (x0 + lineLength,-halfWidth - arrowHalfWidth,0)
    -- (x0 + lineLength + arrowLength,0,0)
    -- (x0 + lineLength,halfWidth + arrowHalfWidth,0)
    -- (x0 + lineLength,halfWidth,0)
    -- (x0,halfWidth,0)
    -- cycle );
}

void drawArrowY(real x, real v)
{
  real arrowHalfWidth = 0.07;
  real arrowLength = 0.2;
  
  real absV = abs(v);
  real dir = v / absV;
  real newV = dir * (absV - arrowLength);
  
  draw( (x, 0, 0) -- (x, newV, 0));
  
  draw(
       ( x - arrowHalfWidth, newV, 0)
    -- ( x, v, 0)
    -- ( x + arrowHalfWidth, newV, 0)
    -- cycle );
}

void drawArrowZ(real x, real v)
{
  real arrowHalfWidth = 0.07;
  real arrowLength = 0.2;
  
  real absV = abs(v);
  real dir = v / absV;
  real newV = dir * (absV - arrowLength);
  
  draw( (x, 0, 0) -- (x, 0, newV));
  
  draw(
       ( x - arrowHalfWidth, 0, newV)
    -- ( x, 0, v)
    -- ( x + arrowHalfWidth, 0, newV)
    -- cycle );
}

void drawSineArrowsY(int i)
{
  real x;
  real z;
  
  x = pi * i + pi * 0.1;
  z = -2 * sin(x);
  drawArrowY(x, z);
  x = pi * i + pi * 0.3;
  z = -2 * sin(x);
  drawArrowY(x, z);
  x = pi * i + pi * 0.5;
  z = -2 * sin(x);
  drawArrowY(x, z);
  x = pi * i + pi * 0.7;
  z = -2 * sin(x);
  drawArrowY(x, z);
  x = pi * i + pi * 0.9;
  z = -2 * sin(x);
  drawArrowY(x, z);
}

void drawSineArrowsZ(int i)
{
  real x;
  real z;
  
  x = pi * i + pi * 0.1;
  z = 2 * sin(x);
  drawArrowZ(x, z);
  x = pi * i + pi * 0.3;
  z = 2 * sin(x);
  drawArrowZ(x, z);
  x = pi * i + pi * 0.5;
  z = 2 * sin(x);
  drawArrowZ(x, z);
  x = pi * i + pi * 0.7;
  z = 2 * sin(x);
  drawArrowZ(x, z);
  x = pi * i + pi * 0.9;
  z = 2 * sin(x);
  drawArrowZ(x, z);
}

void drawArrowsY()
{
  drawSineArrowsY(0);
  drawSineArrowsY(1);
  drawSineArrowsY(2);
  drawSineArrowsY(3);
}

void drawArrowsZ()
{
  drawSineArrowsZ(0);
  drawSineArrowsZ(1);
  drawSineArrowsZ(2);
  drawSineArrowsZ(3);
}

void drawLambdaBarX()
{
  real x0 = pi * 0.5;
  real x1 = pi * 2.5;
  real m = 0.5 * (x1 + x0);
  real z = 2.3;
  real halfWidth = 0.07;
  
  draw( (x0, 0.0, z) -- (x1, 0.0, z) );
  draw( (x0, 0.0, z - halfWidth) -- (x0, 0.0, z + halfWidth) );
  draw( (x1, 0.0, z - halfWidth) -- (x1, 0.0, z + halfWidth) );
  
  draw("$\lambda$",(m,0,2.6));
}


real x1(real x) {return x;}
real y1(real x) {return 0.0;}
real z1(real x) {return 2.0 * sin(x);}

real x2(real x) {return x;}
real y2(real x) {return -2.0 * sin(x);}
real z2(real x) {return 0.0;}


// Draw the arrows.
drawArrowX();
drawArrowsY();
drawArrowsZ();

// Draw the sines.
draw(graph(x1,y1,z1,0.0,4pi));
draw(graph(x2,y2,z2,0.0,4pi));

// Draw the wave length meter.
drawLambdaBarX();

draw("$\vec E$",(10,0,-2));
draw("$\vec B$",(12,0,1.5));
Adobe version
InfoField
 
The SVG code is valid.
 
This vector image was created with Adobe Illustrator.


Licensing

I, the copyright holder of this work, hereby publish it under the following licenses:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
GNU head Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled GNU Free Documentation License.
You may select the license of your choice.

Captions

Add a one-line explanation of what this file represents

Items portrayed in this file

depicts

24 May 2010

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current18:34, 24 May 2010Thumbnail for version as of 18:34, 24 May 2010588 × 352 (13 KB)LennyWikipedia~commonswiki{{Information |Description= |Source={{own}} |Date= |Author= Lenny222 |Permission= |other_versions= }}

The following page uses this file:

Global file usage

The following other wikis use this file: