page logo, three tetrahedra
intersecting a sphere
home
research gallery
  • origami
  • gallery
    crease diagrams
    diagrams
    basic folds
    constructions
    books
    links
    fold language
    fold math
    simulation
  • programming
  • biology inspired
  • photography
  • number notes
  • linear interpolation
    origami: fold math
    penny histogram
  • rants
  • games
  • misc


  •   Origami Fold Math

    To write the origami simulation system which helped me produce some of the crease diagrams on this site, I had to solve the various simple and not so simple mathematical problems which arose from my explorations into how origami works. This page contains the basics needed for implementing my mathematical model of origami in your favorite programming language.

    If you want to know more about the axioms of origami and my take on the subject, read the introduction section on the page about my fold language. O0, O8, and O9 are not generally recognized as axioms of origami, but were important for the development of the model. They define actions in folding which normally occur automatically as a result of the actions inherent in folding. In writing the programs which run the model, these actions did not take place automatically and so needed to be defined in a rigorous manner.


    This model uses lines in the general form:   [lA] Aax + Bay + Ca = 0

    This model uses points :   [pB] (Xb, Yb)

    Constants are in upper case. Variables are in lower case.

    Lower case subscripts are used to identify which line or point a constant comes from.


    I've derived equations for using each origami axiom. Some axioms have single equation solutions. Other axioms have multiple equation solutions which depend on specific circumstances that will be outlined.


    diagram showing origami axiom O0. (O0): Given two lines lA and lB, we can form a unique point by their intersection. (lA @ lB) = pC


    If (AaBb = AbBa) then the lines are parallel and there is no solution point.

    If (AaBb = AbBa) and ((CaBb = CbBa) or (CaAb = CbAa)) then the lines are coincident and there is no solution point.


    If the lines are not coincident and (AaBb != AbBa), we get the point defined by these equations.
    x=(Ba*Cb-Bb*Ca)/(Aa*Bb-Ab*Ba); y=(Ab*Ca-Aa*Cb)/(Aa*Bb-Ab*Ba)


    diagram showing origami axiom O1. (O1): Given two points pA and pB, we can fold a unique line through them. (pA <-> pB) = lC


    If (Xa = Xb) and (Ya = Yb) then the points are identical and there is no solution line.


    If (Xa != Xb) and (Ya != Yb), we get the line defined by this equation.
    (Ya-Yb)x+(Xb-Xa)y+(Yb*Xa-Xb*Ya)=0


    diagram showing origami axiom O2. (O2): Given two points pA and pB, we can fold a unique line by folding pA onto pB. (pA <=> pB) = lC


    If (Xa = Xb) and (Ya = Yb) then the points are identical and there is no solution line.


    If (Xa != Xb) and (Ya != Yb), we get the line defined by this equation.
    (Xb-Xa)x+(Yb-Ya)y+(Xa^2-Xb^2+Ya^2-Yb^2)/2=0


    diagram showing origami axiom O3. (O3): Given two lines lA and lB, we can fold one or two lines by folding lA onto lB. (lA <=> lB) = [lC,lD]


    If (AaBb = AbBa) and ((CaBb = CbBa) or (CaAb = CbAa)) then the lines are coincident and there are no usefull solution lines. One would be identical to the given lines and the other would be perpendicular to the given lines at an infinite position.


    If (AaBb = AbBa), the two given lines are parallel. If (Ba = 0) and (Bb = 0), the lines are vertical and we get one line defined by this equation.
    (2AaAb)x+(CaAb+CbAa)=0

    If the two given lines are parallel and (Ba != 0) and (Bb != 0), the lines are not vertical and we get one line defined by this equation.
    AaBbx+BaBby+(CaBb+CbBa)/2=0


    If the two given lines are not parallel, we get two solution lines. You will need an arctangent function which understands which quadrant the numbers fed into the function are in. The function name would be "Atan2" or some variation of it in most languages.

    The first solution line is defined by this equation.

    The second solution line is defined by this equation.


    diagram showing origami axiom O4. (O4): Given a point pA and a line lB, we can fold a unique line perpendicular to lB through pA. (pA <-> lB) = lC


    This axiom has no conditions and the solution line is defined by this equation.


    diagram showing origami axiom O5. (O5): Given a point pA, a line lB, and another point pC, we can fold zero, one, or two lines through pC by placing pA onto lB. (pA <=> lB):pC = [null,lD,lE]


    Two distances are important in determining how many solutions we have. D1 is the distance from pA to pC. D2 is the distance from pA to lB.


    If (D1 < D2), there are no solutions.

    If (D1 = 0) and (D2 = 0), there are no solutions.


    If (D1 = D2) and (D1 != 0), there is one solution. The following equations define a point which when folded onto pA, by axiom O2, will give us the single solution line.


    If (D1 > D2) and (D2 != 0), there are two solutions. The following equations define a pair of points which when folded onto pA, by axiom O2, will give us the pair of solution lines.

    If (Bb = 0), the line lB is vertical and the following equations define the points we are looking for.

    If (Bb != 0), the line lB is not vertical and the following equations define the points we are looking for.

    Solving quadratic equations is straightforward enough, so I won't go into details about how to do so.


    If (D2 = 0) and (D1 != 0), we have two solutions. The first solution line is found by applying axiom O1 to pA and pC. The second solution line is found by applying axiom O4 to pC and lB. These solutions are found as a limit of the previous equations as pA approaches lB.


    diagram showing origami axiom O6. (O6): Given two points pA and pC and two lines lB and lD, we can fold zero, one, two, or three lines by placing pA onto lB and pC onto lD. (pA <=> lB):(pC <=> lD) = [null,lE,lF,lG]

    The solution to this situation is a bit more involved than the others. The solution lines are equivalent to lines simultaneously tangent to two parabolas. One parabola is formed between pA and lB, the second formed between pC and lD. There are between zero and three lines tangent to any given pair of parabolas.

    Finding what slope corresponds to those zero to three lines is where the next equation comes in. Solving a cubic equation in a general sense is not so easy as solving a quadratic equation, but it is possible. For now, you will have to find another source for the algorithm.


    There are several special case solutions. The cases are determined by the constants from the above cubic equation and the distances between each point and line pair.


    If (Am = 0), (Bm = 0), (Cm = 0), and (Dm = 0), then there are no solution lines. This condition is equivalent to the points being equivalent and the lines being equivalent.


    If (D1 != 0) and (D2 != 0) and (Am = 0), one solution is a vertical line. The vertical line may be located at x=infinity (we'll deal with infinity position lines later). The slopes of the other two solutions are found by solving (Bmm2+Cmm+Dm = 0). Only real values correspond to the solution lines we're looking for.

    If (D1 != 0) and (D2 != 0) and (Dm = 0), one solution is a horizontal line. The horizontal line may be located at y=infinity (we'll deal with infinity position lines later). The slopes of the other two solutions are found by solving (Amm2+Bmm+Cm = 0). Only real values correspond to the solution lines we're looking for.

    If (D1 != 0) and (D2 != 0) and (Am != 0) and (Dm != 0), the slopes for the solutions are found by solving the cubic equation given above. Only real values correspond to the solution lines we're looking for.

    If (D1 = 0) and (D2 != 0), the situation breaks down into axiom O5 [(pC <=> lD):pA] and axiom O7 [(pC <=> lD):lB].

    If (D1 != 0) and (D2 = 0), the situation breaks down into axiom O5 [(pA <=> lB):pC] and axiom O7 [(pA <=> lB):lD].

    If (D1 = 0) and (D2 = 0), the situation breaks down into axiom O1 [(pA <-> pC)], axiom O7 [(pA <=> lB):lD], and another axiom O7 [(pC <=> lD):lB].


    At this point you should be able to find the slopes for each solution line for this type of fold. The next step is to form lines tangent to the parabolas using these slopes. The slope of a line is written as ΔY/ΔX (or rise/run), but we need to get rid of the denominator to avoid any divide-by-zero errors. The following equation will give you the line tangent to the parabola defined by pA and lB for any given combination of ΔX and ΔY. Since we've found these lines to be tangent to the parabola defined by pC and lD, there is no need to include constants from those objects.

    If (ΔY = 0) and (Bb = 0), the line is horizontal at a y-position of infinity. The line given by the equation for this condition will be nonsense.

    If (ΔX = 0) and (Ab = 0), the line is vertical at a x-position of infinity. The line given by the equation for this condition will be nonsense.


    diagram showing origami axiom O7. (O7): Given a point pA and two lines lB and lC, we can fold zero or one line by placing pA onto lB such that the resulting crease is perpendicular to lC. (pA <=> lB):lC = [null,lD]


    If (AaBb = AbBa), then the lines are parallel and there is no usefull solution line. The solution line would be perpendicular to the given lines at an infinite position.


    If (AaBb != AbBa), then the solution line is given by the following equation.


    diagram showing origami axiom O8. (O8): Given a point pA and a line lB, we can form a unique point by reflecting pA across lB. (pA -> lB) = lC


    This axiom has no conditions and the solution point is defined by these equations.


    diagram showing origami axiom O9. (O9): Given two lines lA and lB, we can form a unique line by reflecting lA across lB. (lA -> lB) = lC


    If (AaBb = AbBa) and (Ba = Bb = 0), then the lines are parallel and vertical. The solution line is defined by the following equation.


    If (AaBb = AbBa) and (Ba != 0), then the lines are parallel and not vertical. The solution line is defined by the following equation.


    If (AaBb != AbBa), then the lines are not parallel. The solution line is defined by the following equation.

    Copyright © Darren Abbey.