text:
Computer Generated Cracked Soil
Write a program that takes in an integer from 0 to 65535 (216-1) and generates a unique 500×500 pixel image that looks as similar as possible to these 6 real life images of cracked soil:

These are thumbnails, click them to see the full-size 500×500 images.
The goal here is to make your computer generated images as photorealistic as possible. So ideally, if any of the images output by your program were mixed in with the 6 images above, someone seeing the images for the first time would not be able to tell the computer generated ones apart from the real ones.
Perfect photorealism is tricky however, so just do the best you can. This is a popularity-contest so the answers that have more realistic outputs will be upvoted more and be more likely to win.
Rules

You may use image processing functions or libraries.

You may base your algorithm on information gathered from the 6 sample images, but your 65536 (216) possible output images should be visually distinct from each other and the sample images, especially with regard to the arrangement of the cracks. You must truly generate your images, don't just rotate and translate a selection from a preexisting photo.

You should not otherwise hardcode your outputs. A generic algorithm should be used and numbers larger than 65535 should theoretically produce valid outputs. (I've restricted it merely to accommodate small-maximum integer types.)

The input integer can be thought of as a seed that results in a random cracked soil output image. It should be deterministic though, so the same input should always result in the same output.

The output images must be exactly 500×500 pixels.

The output images may be saved in any common image file format, or simply displayed.

Be sure to include a few example output images in your answer, and their corresponding input numbers.

The answer with the most votes wins. Voters should of course upvote answers that attempt to produce images similar to the 6 samples, and downvote answers that break rules or give inconsistent results.

The 6 sample images were taken from texturelib.com. 1000×1000 pixel area selections were taken from two larger images of cracked soil and then resized to 500×500. You may use analysis from these larger images in your program but the output should specifically imitate the 6 chosen sample images.

You might want to clarify to make photorealistic objective.

How do you come up with so many ideas for challenges? I can only think of 1/month or so.

@NoOneIsHere This particular challenge genre is easy to come up with ideas for. Instead of a cracked soil texture you could do wood grain or gravel or grass or oriented strand board. (Though their reception on this site might be variable.)

I've voted to close this challenge as Too Broad because it lacks objective validity criteria.

@TimmyD Note that this challenge is very similar to my previous challenge Computer Generated Textured Wall Paint, which was received quite well.

@HelkaHomba We've discussed this thoroughly and also added this as a rule in the tag description of [tag:popularity-contest]. So please add an explicit objective validity criterion.

PS: I actually think this is a great challenge idea, but it might have benefitted from a while in the sandbox!

@HelkaHomba Whether an old challenge was well-received or not shouldn't have bearing on whether a challenge now fits with the rules of the site as decided by consensus. PopCons have had tremendous discussion over the past months, one of the results was that all PopCons need an objective validity criterion. This challenge doesn't have that. Thus, it's too broad.

The current rules about pop cons are so dumb that I'd take this chance to ignore them and see how it works out. This topic has been brought up on meta where it's discussed to death but nothing actually changes, so I think the best chance at something happening is to keep some pop cons and see how they do.

The objective validity criteria here are "unique" (distinct from the other 65535) and "500x500 pixel". The resemblance to the example images cannot be objectively defined, or this wouldn't be a popularity contest but a code challenge.

Resemblance to a single target image can be defined in a variety of ways, meaning that popularity contest is not necessarily the only possible winning criterion. However, for an array of example images, where the objective is realism rather than replication, it makes most sense to use human judgment as the winning criterion.

I see bad pop cons like "make something pretty" with no restriction, and good pop cons like "match this specification" with humans voting on which matches best. I definitely see this challenge as the good kind.

I don't get it. What's the point of taking an input?

@DrGreenEggsandIronMan So the output is repeatable - deterministic but varied.

I can already tell, I need a seeded voronoi diagram for this.

2 actually, 1 for the larger gaps abd 1 for the smaller ones

@xnor, the last unclosed popcon before this one was 5 months ago. Although they were originally allowed to stay in contravention of the site norms as a measure to help it get off the ground, it's clear that the site no longer needs to make exceptions in order to survive, so I think that explicitly encouraging people to turn a blind eye to the norms is unhelpful.

@Bálint Look closer - there are smaller cracks again...

@PeterTaylor dumb rules do not help either

Shouldn't you combine code-challenge with popularity-contest?

Mathematica
A Voronoi diagram looks like this drawing, from Wikipedia, showing 19 cells, each containing a single seed point.   A cell consists of the subregion of points which the respective generating point is closer to than any of the other seed points.

The code below generates a diagram from 80 random points (in the square region bound by (-1,-1) and (1,1)).
It uses the polygon primitives (in 2D) in the diagram to build polyhedra (in 3D).  Imagine that each polygon has, just under it, a translation (-.08 in z) of itself. Think of the two polygons as the upper and lower face of a polyhedron.  "Side faces" are then added to complete the polyhedron.
Each polyhedron is then translated outwards, from the center of the image, on the xy plane; it moves away from the middle. The magnitude of the translation varies directly with the distance between the polyhedron's original generating random point and the center of the screen. This "spreading out" of the polyhedra in the xy plane results in crevices.
crackedMud[1]

crackedMud[65535]

Code
ClearAll[polyhedronFromPolygon, voronoiPolygons, generatingPointFromPolygon, crackedMud]

(* polyhedronFromPolygon returns a single polyhedron from a polygon *)

polyhedronFromPolygon[polygon_] :=
 Module[{twoPolygons, verticesOfUpperPolygonCell, nVertices, n = 1},
 verticesOfUpperPolygonCell = Join @@ (polygon[[1]] /. {x_, y_} :> {{x, y, 0}, {x, y, -.08}});
 (* number of vertices in a single *Voronoi* cell *)
 nVertices = Length[verticesOfUpperPolygonCell]/2;

(*vertex indices of the upper and lower polygon faces *)
twoPolygons = Select[Range@(2*nVertices), #] & /@ {OddQ, EvenQ};

(*vertex indices of a rectangular face of the polyhedron *)
While[n < nVertices + 1, AppendTo[twoPolygons,
    {twoPolygons[[1, n]], twoPolygons[[2, n]],
     twoPolygons[[2, If[n + 1 < nVertices + 1, n + 1, 1]]],
     twoPolygons[[1, If[n + 1 < nVertices + 1, n + 1, 1]]]}]; n++];
(*the graphics complex returned is a polyhedron, even though it says Polygon *)
 GraphicsComplex[verticesOfUpperPolygonCell, Polygon[twoPolygons]] ]

(* takes two dimensional coordinates and returns all of the cells of a Voronoi diagram *)

voronoiPolygons[pts_] :=
Module[{voronoiRegion, data},
  voronoiRegion = VoronoiMesh[pts, ImageSize -> Medium,
  PlotTheme -> "Lines", Axes -> True, AxesOrigin -> {0, 0}];
  data = Join @@ (MeshPrimitives[voronoiRegion, 2][[All, 1]] /. {x_, y_} :> {{x, y, 0}, {x, y, .04}});
 (* the mesh primitives are the polygons *)
  MeshPrimitives[voronoiRegion, 2]]

(* Returns, in 3D, the point which was used to generate the nth Voronoi cell. *)
generatingPointFromPolygon[n_, points_, pgons_] :=
 FirstCase[points, {x_, y_} /; RegionMember[pgons[[n]], {x, y}] :> {x,y,0}]

crackedMud[seedNumber_] :-
 Module[{pts, pts3D, geometricImage, nPts, polygons, polyhedra, centerPtinImage},
  SeedRandom[seedNumber];
  nPts = 80;
  pts = RandomReal[{-1, 1}, {nPts, 2}];
  pts3D = pts /. {x_, y_} :> {x, y, .0};
  polygons = voronoiPolygons[pts];
  polyhedra = polyhedronFromPolygon /@ polygons;
  centerPtinImage =   (Mean /@ (PlotRange /.
        AbsoluteOptions[
         Graphics3D[{polyhedra, Blue, Point@pts3D}, Axes -> False,
         Boxed -> False]])) /. {x_Real, y_, _} :> {x, y, 0};
  geometricImage =
  Graphics3D[{RGBColor[0.75, 0.75, 0.8], EdgeForm[Darker@Gray],
        (* # is the nth polygon which yields the nth polyhedron *)
        (* generatingPointFromPolygon returns the point the generated the #th polygon *)

     GeometricTransformation[{polyhedronFromPolygon[polygons[[#]]]},
        TranslationTransform[(generatingPointFromPolygon[#, pts, polygons] - centerPtinImage)/5]] & /@ Range@nPts},
         Axes -> False,  Boxed -> False, ViewPoint -> {0., -1, 1.5},
         Background -> Black, ImageSize -> 1200];

     (*ImageTrim returns a 500 by 500 pixel clip from the center of the image *)
     ImageTrim[
        (*ImageEffect speckles the image *)
        ImageEffect[Rasterize[geometricImage], {"Noise", 1/5}],
     {{250, 250}, {750, 750}}]
  ]

You might do well to adapt into this to a shattered-glass pattern maker.

@Sparr, yes it does look like shattered glass (or tiles).

Golfed........?

@cat No, it's not golfed.

@DavidC Where's all the whitespace? Do you write it like that? Do Wolfram enforce unreadable code?

@cat,  I realize that the code was very cryptic.  Now the code should be more readable.  If you would like any clarifications, just ask.

Java
I used an approach based on recursive Voronoi diagrams. The outputs doesn't look very realistic, but I guess they're okay.
Here are some example images (resized to 250x250 so that it doesn't fill the entire screen):
0:

1:

More details about the algorithm:
All images in this section are using the same seed.
The algorithm starts by generating a Voronoi diagram with 5 points:

If we look at the original images in the challenge, we can see that the lines aren't all straight like that, so we weigh the distance by a random value, based on the angle to the point, also, closer angles gives closer values:

Now, we recursively draw these kinds of Voronoi diagrams inside of each region, with thinner and more transparent line, and remove the background, with a maximum recursion depth of 3, and we get:

Now, we just add the pale brown background, and we're done!

Code:
The code consists of three classes, Main.java, VoronoiPoint.java and Vector.java:
Main.java:
import java.awt.Desktop;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Random;

import javax.imageio.ImageIO;

public class Main {
    public static int WIDTH = 500;
    public static int HEIGHT = 500;
    public static int RECURSION_LEVELS = 3;
    public static int AMOUNT_OF_POINTS = 5;
    public static int ROTATION_RESOLUTION = 600;
    public static int ROTATION_SMOOTHNESS = 10;
    public static int BACKGROUND = 0xFFE0CBAD;

    public static Random RAND;

    public static void main(String[] args) {

        int seed = new Random().nextInt(65536);
        if (args.length == 1) {
            System.out.println(Arrays.toString(args));
            seed = Integer.parseInt(args[0]);
        } else {
            System.out.println("Generated seed: " + seed);
        }
        RAND = new Random(seed);

        ArrayList<Vector> points = new ArrayList<Vector>();
        for (int x = 0; x < WIDTH; x++) {
            for (int y = 0; y < HEIGHT; y++) {
                points.add(new Vector(x, y));
            }
        }
        BufferedImage soil = generateSoil(WIDTH, HEIGHT, seed, points, AMOUNT_OF_POINTS, RECURSION_LEVELS);

        BufferedImage background = new BufferedImage(WIDTH, HEIGHT, BufferedImage.TYPE_INT_ARGB);
        for (int x = 0; x < background.getWidth(); x++) {
            for (int y = 0; y < background.getHeight(); y++) {
                background.setRGB(x, y, BACKGROUND ^ (RAND.nextInt(10) * 0x010101));
            }
        }

        Graphics g = background.getGraphics();
        g.drawImage(soil, 0, 0, null);
        g.dispose();

        String fileName = "soil";
        File output = new File(fileName + ".png");
        for (int i = 0; output.exists(); i++) {
            output = new File(fileName + i + ".png");
        }
        try {
            ImageIO.write(background, "png", output);
            Desktop.getDesktop().open(output);
        } catch (IOException e) {
            e.printStackTrace();
        }
        System.out.println("Done. Saved as " + output);
    }

    private static BufferedImage generateSoil(int width, int height, int seed, ArrayList<Vector> drawPoints,
            int amountOfPoints, int recursionLevel) {

        BufferedImage result = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);

        ArrayList<VoronoiPoint> points = new ArrayList<VoronoiPoint>();
        for (int i = 0; i < amountOfPoints; i++) {
            points.add(new VoronoiPoint(drawPoints.get(RAND.nextInt(drawPoints.size()))));
        }

        HashMap<Integer, ArrayList<Vector>> pointMaps = new HashMap<Integer, ArrayList<Vector>>();
        for (VoronoiPoint point : points) {
            pointMaps.put(point.hashCode(), new ArrayList<Vector>());
        }
        System.out.println(pointMaps);

        System.out.println(points);

        for (Vector v : drawPoints) {
            VoronoiPoint closest = null;
            VoronoiPoint secondClosest = null;

            for (VoronoiPoint point : points) {
                double distance = point.getMultiplicativeDistanceTo(v);
                if (closest == null || distance < closest.getMultiplicativeDistanceTo(v)) {
                    secondClosest = closest;
                    closest = point;
                } else if (secondClosest == null || distance < secondClosest.getMultiplicativeDistanceTo(v)) {
                    secondClosest = point;
                }
            }

            int col = 0;
            if (Math.abs(closest.getMultiplicativeDistanceTo(v)
                    - secondClosest.getMultiplicativeDistanceTo(v)) < (recursionLevel * 5 / RECURSION_LEVELS)) {
                col = 0x01000000 * (recursionLevel * 255 / RECURSION_LEVELS);
            } else {
                pointMaps.get(closest.hashCode()).add(v);
            }
            result.setRGB((int) v.getX(), (int) v.getY(), col);
        }
        Graphics g = result.getGraphics();
        if (recursionLevel > 0) {
            for (ArrayList<Vector> pixels : pointMaps.values()) {
                if (pixels.size() > 10) {
                    BufferedImage img = generateSoil(width, height, seed, pixels, amountOfPoints,
                            recursionLevel - 1);
                    g.drawImage(img, 0, 0, null);
                }
            }
        }
        g.dispose();

        return result;
    }

    public static int modInts(int a, int b) {
        return (int) mod(a, b);
    }

    public static double mod(double a, double b) {
        a = a % b;
        while (a < 0)
            a += b;
        return a;
    }
}

VoronoiPoint.java:
public class VoronoiPoint {

    private Vector pos;
    private double[] distances;

    public VoronoiPoint(Vector pos) {
        this.pos = pos;
        distances = new double[Main.ROTATION_RESOLUTION];
        for (int i = 0; i < distances.length; i++)
            distances[i] = Main.RAND.nextFloat() / 2 + 0.51;

        for (int iter = 0; iter < Main.ROTATION_SMOOTHNESS; iter++) {
            for (int i = 0; i < distances.length; i++) {
                distances[i] = (distances[Main.modInts(i - Main.RAND.nextInt(4) - 2, distances.length)] + distances[i]
                        + distances[Main.modInts(i + Main.RAND.nextInt(4) - 2, distances.length)]) / 3;
            }
        }
    }

    public Vector getPos() {
        return pos;
    }

    public double getRotationFromAngle(double radians) {
        return distances[(int) (Main.mod(Math.toDegrees(radians) / 360, 1) * distances.length)];
    }

    public double getRotationFromVector(Vector vec) {
        return getRotationFromAngle(Math.atan2(pos.getY() - vec.getY(), -(pos.getX() - vec.getX())));
    }

    public double getMultiplicativeDistanceTo(Vector other) {
        return pos.getLengthTo(other) * getRotationFromVector(other);
    }

    public String toString() {
        return "VoronoiPoint(pos=[" + pos.getX() + ", " + pos.getY() + "])";
    }

    public int hashCode() {
        return distances.hashCode() ^ pos.hashCode();
    }
}

Vector.java: (This class is copied from one of my other projects, so it contains some unnecessary code)
package com.loovjo.soil;

import java.util.ArrayList;
import java.util.Random;

public class Vector {
    private static final float SMALL = 1f / Float.MAX_EXPONENT * 100;
    private float x, y;

    public Vector(float x, float y) {
        this.setX(x);
        this.setY(y);
    }

    public Vector(int x, int y) {
        this.setX(x);
        this.setY(y);
    }

    public Vector(double x, double y) {
        this.setX((float) x);
        this.setY((float) y);
    }

    public float getY() {
        return y;
    }

    public void setY(float y) {
        this.y = y;
    }

    public float getX() {
        return x;
    }

    public void setX(float x) {
        this.x = x;
    }

    /*
     * Gets the length ^ 2 This is faster than getting the length.
     */
    public float getLengthToSqrd(float x, float y) {
        return (float) ((this.x - x) * (this.x - x) + (this.y - y) * (this.y - y));
    }

    public float getLengthToSqrd(Vector v) {
        return getLengthToSqrd(v.x, v.y);
    }

    public float getLengthSqrd() {
        return getLengthToSqrd(0, 0);
    }

    public float getLengthTo(float x, float y) {
        return (float) Math.sqrt(getLengthToSqrd(x, y));
    }

    public float getLengthTo(Vector v) {
        return getLengthTo(v.x, v.y);
    }

    public float getLength() {
        return getLengthTo(0, 0);
    }

    public Vector setLength(float setLength) {
        float length = getLength();
        x *= setLength / length;
        y *= setLength / length;
        return this;
    }

    public float getFastLengthTo(float x, float y) {
        return getFastLengthTo(new Vector(x, y));
    }

    public float getFastLengthTo(Vector v) {
        float taxiLength = getTaxiCabLengthTo(v);
        float chebyDist = getChebyshevDistanceTo(v);
        return Float.min(taxiLength * 0.7f, chebyDist);
    }

    public float getFastLength() {
        return getLengthTo(0, 0);
    }

    public Vector setFastLength(float setLength) {
        float length = getFastLength();
        x *= setLength / length;
        y *= setLength / length;
        return this;
    }

    public float getTaxiCabLengthTo(float x, float y) {
        return Math.abs(this.x - x) + Math.abs(this.y - y);
    }

    public float getTaxiCabLengthTo(Vector v) {
        return getTaxiCabLengthTo(v.x, v.y);
    }

    public float getTaxiCabLength() {
        return getTaxiCabLengthTo(0, 0);
    }

    public Vector setTaxiCabLength(float setLength) {
        float length = getTaxiCabLength();
        x *= setLength / length;
        y *= setLength / length;
        return this;
    }

    public Vector absIfBoth() {
        if (x < 0 && y < 0)
            return new Vector(-x, -y);
        return this;
    }

    public Vector abs() {
        return new Vector(x < 0 ? -x : x, y < 0 ? -y : y);
    }

    public float getChebyshevDistanceTo(float x, float y) {
        return Math.max(Math.abs(this.x - x), Math.abs(this.y - y));
    }

    public float getChebyshevDistanceTo(Vector v) {
        return getChebyshevDistanceTo(v.x, v.y);
    }

    public float getChebyshevDistance() {
        return getChebyshevDistanceTo(0, 0);
    }

    public Vector setChebyshevLength(float setLength) {
        float length = getChebyshevDistance();
        x *= setLength / length;
        y *= setLength / length;
        return this;
    }

    public Vector sub(Vector v) {
        return new Vector(this.x - v.getX(), this.y - v.getY());
    }

    public Vector add(Vector v) {
        return new Vector(this.x + v.getX(), this.y + v.getY());
    }

    public Vector mul(Vector v) {
        return new Vector(this.x * v.getX(), this.y * v.getY());
    }

    public Vector mul(float f) {
        return mul(new Vector(f, f));
    }

    public Vector div(Vector v) {
        return new Vector(this.x / v.getX(), this.y / v.getY());
    }

    public Vector div(float f) {
        return div(new Vector(f, f));
    }

    public Vector mod(Vector v) {
        return new Vector(this.x % v.getX(), this.y % v.getY());
    }

    public Vector mod(int a, int b) {
        return mod(new Vector(a, b));
    }

    public Vector mod(int a) {
        return mod(a, a);
    }

    public String toString() {
        return "Vector(" + getX() + ", " + getY() + ")";
    }

    /*
     * Returns a list with vectors, starting with this, ending with to, and each
     * one having length between them
     */
    public ArrayList<Vector> loop(Vector to, float length) {
        Vector delta = this.sub(to);
        float l = delta.getLength();
        ArrayList<Vector> loops = new ArrayList<Vector>();
        for (float i = length; i < l; i += length) {
            delta.setLength(i);
            loops.add(delta.add(to));
        }
        loops.add(this);

        return loops;
    }

    public boolean intersects(Vector pos, Vector size) {
        pos.sub(this);
        if (pos.getX() < getX())
            return false;
        if (pos.getY() < getY())
            return false;
        return true;
    }

    public Vector copy() {
        return new Vector(x, y);
    }

    public void distort(float d) {
        x += Math.random() * d - d / 2;
        y += Math.random() * d - d / 2;
    }

    @Override
    public boolean equals(Object o) {
        if (o instanceof Vector) {
            Vector v = (Vector) o;
            return getLengthToSquared(v) < SMALL * SMALL;
        }
        return false;
    }

    private float getLengthToSquared(Vector v) {
        return sub(v).getLengthSquared();
    }

    private float getLengthSquared() {
        return x * x + y * y;
    }

    public boolean kindaEquals(Vector o, int i) {
        if (o.x + i < x)
            return false;
        if (o.x - i > x)
            return false;
        if (o.y + i < y)
            return false;
        if (o.y - i > y)
            return false;
        return true;
    }
    /*
     * Gets the direction, from 0 to 8.
     */
    public int getDirection() {
        return (getDirectionInDegrees()) / (360 / 8);
    }
    /*
     * Gets the direction in degrees.
     */
    public int getDirectionInDegrees() {
        return (int) positize((float) Math.toDegrees(Math.atan2(x, -y)), 360f);
    }

    private float positize(float f, float base) {
        while (f < 0)
            f += base;
        return f;
    }
    // 0 = north,
            // 1 = northeast,
            // 2 = east,
            // 3 = southeast,
            // 4 = south,
            // 5 = southwest,
            // 6 = west,
            // 7 = northwest
    public Vector moveInDir(int d) {
        d = d % 8;
        d = (int) positize(d, 8);

        if (d == 0)
            return this.add(new Vector(0, -1));
        if (d == 1)
            return this.add(new Vector(1, -1));
        if (d == 2)
            return this.add(new Vector(1, 0));
        if (d == 3)
            return this.add(new Vector(1, 1));
        if (d == 4)
            return this.add(new Vector(0, 1));
        if (d == 5)
            return this.add(new Vector(-1, 1));
        if (d == 6)
            return this.add(new Vector(-1, 0));
        if (d == 7)
            return this.add(new Vector(-1, -1));
        return this;
    }
    /*
     * Gets the angle in degrees to o.
     */
    public float getRotationTo(Vector o) {
        float d = (float) Math.toDegrees((Math.atan2(y - o.y, -(x - o.x))));
        while (d < 0)
            d += 360;
        while (d > 360)
            d -= 360;
        return d;
    }
    public float getRotation() {
        return getRotationTo(new Vector(0, 0));
    }
    /*
     * In degrees
     */
    public Vector rotate(double n) {
        n = Math.toRadians(n);
        float rx = (float) ((this.x * Math.cos(n)) - (this.y * Math.sin(n)));
        float ry = (float) ((this.x * Math.sin(n)) + (this.y * Math.cos(n)));
        return new Vector(rx, ry);
    }

    public int hashCode() {
        int xx = (int) x ^ (int)(x * Integer.MAX_VALUE);
        int yy = (int) y ^ (int)(y * Integer.MAX_VALUE);
        return new Random(12665 * xx).nextInt() ^ new Random(5349 * yy).nextInt() + new Random((30513 * xx) ^ (19972 * yy)).nextInt();
    }

    public boolean isPositive() {
        return x >= 0 && y >= 0;
    }

    public Vector clone() {
        return new Vector(x, y);
    }
}

But I don't want to compile a bunch of Java classes!
Here is a JAR file which you can run to generate these images yourself. Run as java -jar Soil.jar number, where number is the seed (can be anything up to 231-1), or run as java -jar Soil.jar, and it chooses a seed by itself. There will be some debug output.

For some reason I find those images both fairly realistic and also completely fake. The lack of natural shadows is throwing me off.

If it helps, you can upload full sized images and make them small thumbnails like in the challenge post, or medium images that fit 2 across to take less vertical space. In the source of the challenge you can see how adding an "s" in the imgur address makes the images small, and you can also use an "m" for medium. The source also shows how to make the small image into a link to the full size image.

I think the colors could be a lot closer - more gray, less beige. But otherwise nice answer!

Python 3 (using Kivy library and GLSL)
First generated image

Python code:
import os
os.environ['KIVY_NO_ARGS'] = '1'

from kivy.config import Config
Config.set('input','mouse','mouse,disable_multitouch')
Config.set('graphics', 'width', '500')
Config.set('graphics', 'height', '500')
Config.set('graphics', 'resizable', '0')
Config.set('graphics', 'borderless', '1')
Config.set('graphics', 'fbo', 'force-hardware')

from kivy.app import App
from kivy.graphics import RenderContext, Fbo, Color, Rectangle
from kivy.clock import Clock
from kivy.uix.floatlayout import FloatLayout
from kivy.factory import Factory
from kivy.core.window import Window

class ShaderSurface(FloatLayout):
    seed = 0.

    def __init__(self, **kwargs):
        self.canvas = RenderContext(use_parent_projection=True, use_parent_modelview=True)
        with self.canvas:
            self.fbo = Fbo(size=Window.size, use_parent_projection=True)

        with self.fbo:
            Color(0,0,0)
            Rectangle(size=Window.size)

        self.texture = self.fbo.texture

        super(ShaderSurface, self).__init__(**kwargs)
        self.keyboard = Window.request_keyboard(self.keyboard_closed, self)
        self.keyboard.bind(on_key_down=self.on_key_down)
        Clock.schedule_once(self.update_shader,-1)

    def keyboard_closed(self):
        self.keyboard.unbind(on_key_down=self.on_key_down)
        self.keyboard = None

    def update_shader(self, dt=0.):
        self.canvas['resolution'] = list(map(float, self.size))
        self.canvas['seed'] = self.seed
        self.canvas.ask_update()

    def on_key_down(self, keyboard, keycode, text, modifiers):
        if keycode[1] == 'spacebar':
            self.seed += 1.
            self.update_shader()
            Window.screenshot()

Factory.register('ShaderSurface', cls=ShaderSurface)

class RendererApp(App):
    def build(self):
        self.root.canvas.shader.source = 'cracks_sub.glsl'

if __name__ == '__main__':
    RendererApp().run()

KV file:
#:kivy 1.9

ShaderSurface:
    canvas:
        Color:
            rgb: 1, 1, 1
        Rectangle:
            size: self.size
            pos: self.pos
            texture: root.fbo.texture

GLSL code:
---VERTEX---
uniform vec2        resolution;
in vec2             vPosition;

void main()
{
    gl_Position = vec4(vPosition.xy-resolution/2., 0, 1);
}
---FRAGMENT---
#version 330
precision highp float;

out vec4 frag_color;

uniform vec2 resolution;
uniform float seed;

vec2 tr(vec2 p)
{
    p /= resolution.xy;
    p = -1.0+2.0*p;
    p.y *= resolution.y/resolution.x;
    return p;
}

float hash( float n ){
    return fract(sin(n)*43758.5453);
}

float noise( vec2 uv ){
    vec3 x = vec3(uv, 0);

    vec3 p = floor(x);
    vec3 f = fract(x);

    f       = f*f*(3.0-2.0*f);
    float n = p.x + p.y*57.0 + 113.0*p.z;

    return mix(mix(mix( hash(n+0.0), hash(n+1.0),f.x),
                   mix( hash(n+57.0), hash(n+58.0),f.x),f.y),
               mix(mix( hash(n+113.0), hash(n+114.0),f.x),
                   mix( hash(n+170.0), hash(n+171.0),f.x),f.y),f.z);
}

mat2 m = mat2(0.8,0.6,-0.6,0.8);

float fbm(vec2 p)
{
    float f = 0.0;
    f += 0.5000*noise( p ); p*=m*2.02;
    f += 0.2500*noise( p ); p*=m*2.03;
    f += 0.1250*noise( p ); p*=m*2.01;
    f += 0.0625*noise( p );
    f /= 0.9375;
    return f;
}

vec2 hash2( vec2 p )
{
    return fract(sin(vec2(dot(p,vec2(127.1,311.7)),dot(p,vec2(269.5,183.3))))*43758.5453);
}

float voronoi(vec2 x, out vec2 rt)
{
    vec2 p = floor(x);
    vec2 f = fract(x);

    vec2 mb, mr;

    float res = 8.0;
    for( int j=-1; j<=1; j++)
    for( int i=-1; i<=1; i++)
    {
        vec2 b = vec2(float(i),float(j));
        vec2 r = b+hash2(p+b)-f;
        float d = dot(r,r);

        if( d<res )
        {
            res = d;
            mr = r;
            mb = b;
            rt=r;
        }
    }

    res = 8.0;
    for( int j=-2; j<=2; j++ )
    for( int i=-2; i<=2; i++ )
    {
        vec2 b = mb + vec2(float(i),float(j));
        vec2 r = b + hash2(p+b)-f;
        float d = dot((res*res)*(mr+r),normalize(r-mr));

        res = min(res,d);
    }

    return res;
}

float crack(vec2 p)
{
    float g = mod(seed,65536./4.);
    p.x+=g;
    p.y-=seed-g;
    p.y*=1.3;
    p.x+=noise(p*4.)*.08;
    float k = 0.;
    vec2 rb = vec2(.0);
    k=voronoi(p*2.,rb);
    k=smoothstep(.0,.3,k*.05);
    float v = 0.;
    v=voronoi(rb*4.,rb);
    v=smoothstep(.0,.5,v*.05);
    k*=v;
    k-=fbm(p*128.)*.3;
    return k;
}

void main( void )
{
    vec2 fc = gl_FragCoord.xy;
    vec2 p = tr(fc);
    vec3 col = vec3(.39,.37,.25);

    vec3 abb = vec3(.14,.12,.10)/5.;

    p*=(1.+length(p)*.1);

    col.r*=crack(vec2(p.x+abb.x,p.y));
    col.g*=crack(vec2(p.x+abb.y,p.y));
    col.b*=crack(vec2(p.x+abb.z,p.y));

    col*=smoothstep(4.,1.2,dot(p,p));
    col*=exp(.66);

    //col=vec3(crack(p));
    frag_color = vec4(col,1.);
}

The voronoi function in the GLSL code is from Íñigo Quílez. Every voronoi related calculation happens in the fragment shader entirely with some procedural noise functions to create speckles and to disturb the lines of the voronoi pattern a bit.
By pressing space the seed will be increased by 1 and a new image will be generated and saved as a .png file.
Update: Added lense distortion, vignetting and chromatic aberration to make it more photo-realistic. Added sub-voronoi pattern.

Can this also take a seed as input?

The ShaderSurface class has a class member seed. This will be piped to the shader as a uniform float variable. In the shader's crack function the seed is used to translate the point by the seed's value.

Java
import java.awt.Color;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.Random;
import java.util.Scanner;

import javax.imageio.ImageIO;

public class CrackedSoil {
    static BufferedImage b;
    static Random rand;
    public static int distance(int col1,int col2){
        Color a=new Color(col1);
        Color b=new Color(col2);
        return (int)(Math.pow(a.getRed()-b.getRed(), 2)+Math.pow(a.getGreen()-b.getGreen(), 2)+Math.pow(a.getBlue()-b.getBlue(), 2));
    }
    public static void edge(){
        boolean[][] edges=new boolean[500][500];
        int threshold=125+rand.nextInt(55);
        for(int x=1;x<499;x++){
            for(int y=1;y<499;y++){
                int rgb=b.getRGB(x, y);
                int del=0;
                for(int i=-1;i<=1;i++){
                    for(int j=-1;i<=j;i++){
                        del+=distance(rgb,b.getRGB(x+i, y+j));
                    }
                }
                edges[x][y]=del>threshold;
            }
        }
        for(int x=0;x<500;x++){
            for(int y=0;y<500;y++){
                if(edges[x][y])b.setRGB(x, y,new Color(4+rand.nextInt(4),4+rand.nextInt(4),4+rand.nextInt(4)).getRGB());
            }
        }
    }
    public static void main(String[]arg) throws IOException{
        b=new BufferedImage(500,500,BufferedImage.TYPE_INT_RGB);
        Scanner scanner=new Scanner(System.in);
        rand=new Random(scanner.nextInt());
        int numPoints=10+rand.nextInt(15);
        Color[]c=new Color[numPoints];
        int[][]ints=new int[numPoints][2];
        int[]weights=new int[numPoints];
        for(int i=0;i<numPoints;i++){
            switch(i%4){
            case 0:ints[i]=new int[]{251+rand.nextInt(240),7+rand.nextInt(240)};break;
            case 1:ints[i]=new int[]{7+rand.nextInt(240),7+rand.nextInt(240)};break;
            case 2:ints[i]=new int[]{7+rand.nextInt(240),251+rand.nextInt(240)};break;
            case 3:ints[i]=new int[]{251+rand.nextInt(240),251+rand.nextInt(240)};break;
            }

            c[i]=new Color(40+rand.nextInt(200),40+rand.nextInt(200),40+rand.nextInt(200));
            weights[i]=50+rand.nextInt(15);
        }
        for(int x=0;x<500;x++){
            for(int y=0;y<500;y++){
                double d=999999;
                Color col=Color.BLACK;
                for(int i=0;i<numPoints;i++){
                    double d2=weights[i]*Math.sqrt((x-ints[i][0])*(x-ints[i][0])+(y-ints[i][1])*(y-ints[i][1]));
                    if(d2<d){
                        d=d2;
                        col=c[i];
                    }
                }
                b.setRGB(x, y,col.getRGB());
            }
        }
        //ImageIO.write(b,"png",new File("voronoi1.png"));
        for(int i=0;i<numPoints/3;i++){
            ints[i]=new int[]{7+rand.nextInt(490),7+rand.nextInt(490)};
            c[i]=new Color(40+rand.nextInt(200),40+rand.nextInt(200),40+rand.nextInt(200));
            weights[i]=50+rand.nextInt(5);
        }
        for(int x=0;x<500;x++){
            for(int y=0;y<500;y++){
                double d=999999;
                Color col=Color.BLACK;
                for(int i=0;i<numPoints/3;i++){
                    double d2=weights[i]*Math.sqrt((x-ints[i][0])*(x-ints[i][0])+(y-ints[i][1])*(y-ints[i][1]));
                    if(d2<d){
                        d=d2;
                        col=c[i];
                    }
                }
                Color col3=new Color(b.getRGB(x, y));
                b.setRGB(x, y,new Color((col3.getRed()+col.getRed()*3)/4,(col3.getGreen()+col.getGreen()*3)/4,(col3.getBlue()+col.getBlue()*3)/4).getRGB());
            }
        }
        //ImageIO.write(b,"png",new File("voronoi2.png"));
        for(int i=2+rand.nextInt(3);i>0;i--)edge();
        //ImageIO.write(b,"png",new File("voronoi_edge.png"));
        for(int x=0;x<500;x++){
            for(int y=0;y<500;y++){
                Color col=new Color(b.getRGB(x, y));
                if(col.getRed()+col.getBlue()+col.getGreen()>50){
                    if(rand.nextDouble()<0.95){
                        b.setRGB(x, y,new Color(150+rand.nextInt(9),145+rand.nextInt(9),135+rand.nextInt(9)).getRGB());
                    }else{
                        b.setRGB(x, y,new Color(120+col.getRed()/7+rand.nextInt(12),115+col.getGreen()/7+rand.nextInt(12),105+col.getBlue()/7+rand.nextInt(12)).getRGB());
                    }
                }
            }
        }
        ImageIO.write(b,"png",new File("soil.png"));
    }
}

Creates a composite of two random diagrams which is then run through a simple edge detection and finally converted to the final result.
Some outputs:

Some of the intermediate steps for that last one:

(The first voronoi diagram)

(The composite of the two voronoi diagrams)

(After the edge detection step but before the final recoloring)

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
"Bit-borrow" two numbers
Did you know that a small number can borrow bits from a larger number? Here's an example. Let's say our two numbers 5 and 14. First, write them out in binary:
5       14
000101  001110

First we take the smallest on bit away from the larger number, and we give it to the smallest off bit on the other number. So
This bit turns off
            |
            v
000101  001110
    ^
    |
This bit turns on

Now we have
000111  001100

and our numbers are 7 and 12. The first number is still smaller, so we continue.
000111  001100
001111  001000

Now we have 15 and 8, so we can stop. We'll call this set of operations "bit-borrowing" two numbers. Let's do another example. 20 and 61.
20        61
010100    111101
010101    111100
010111    111000
111111    100000
63        32

So our end result is 32, 63. Let's do one more. 31, and 12. 31 is already bigger than 12, so there's nothing to do! Bit-borrowing 31 and 12 gives 31 and 12, no change.
The challenge
Your challenge is to write a program or function that takes two numbers and bit-borrows them. The two numbers will always positive integers. Your input and output can be in any reasonable format.
Test IO:
Input: 2, 3
Output: 3, 2

Input: 3, 2
Output: 3, 2

Input: 8, 23
Output: 31, 0

Input: 42, 81
Output: 63, 0

Input: 38, 41
Output: 47, 32

Input: 16, 73
Output: 23, 0

Input: 17, 17
Output: 17, 17

Standard loopholes apply, and shortest answer in bytes wins!

Jelly, 11 bytes
~1¦&N$^µ</¿

Try it online! or verify all test cases.
Background
We can extract the last set bit of an integer n as follows.
n + 1 toggles all trailing set bits of n and the adjacent unset bit. For example, 100112 + 1 = 101002.
Since ~n = -(n + 1) = -n - 1, -n = ~n + 1, so -n applies the above to the bitwise NOT of n (which toggles all bits), thus toggling all bits before the last 1.
For example, -101002 = ~101002 + 1 = 010112 + 1 = 011002.
By taking n & -n the bitwise AND of n and -n all bits before the last set bit are nullified (since unequal in n and -n), thus yielding the last set bit of n.
For example, 101002 & -101002 = 101002 & 011002 = 001002.
Thus XORing n with n & -n unsets the last set bit of n.
Conversely, to unset the last set bit of n, it suffices to apply the above to ~n, from where we derive the formula n ^ (~n & -~n).
How it works
~1¦&N$^µ</¿  Main link. Argument: A (list of pairs)

          ¿  While loop:
        </     Condition: Reduce p by less-than. True iff x < y.
       µ       Body chain:
~1¦              Apply bitwise NOT to the x, first item of the pair.
     $           Convert the two links to the left into a monadic chain.
    N              Negate; multiply [~x, y] by -1, yielding [-~x, -y].
   &               Logical AND. Yields [-~x & ~x, -y & y].
      ^            Vectorized XOR with p. Yields [(-~x & ~x) ^ x, (-y & y) ^ y].

J, 31 26 bytes
,`(($:~(OR>:))~(AND<:))@.<

Straight-forward approach using recursion and bitwise tricks. In order to turn off (set to 0) the right-most on (1) bit for a value n, you can perform bitwise-and between n and n-1, and to turn on (set to 1) the right-most off (0) bit for a value n, you can perform bitwise-or between n and n+1.
Usage
The input consists of two integers, one applied on the LHS and the other on the RHS, and the output is a list of the bit-borrowed values.
   f =: ,`(($:~(OR>:))~(AND<:))@.<
   2 f 3
3 2
   3 f 2
3 2
   8 f 23
31 0
   42 f 81
63 0
   38 f 41
47 32
   16 f 73
23 0
   17 f 17
17 17

Explanation
,`(($:~(OR>:))~(AND<:))@.<  Input: x on LHS, y on RHS
                            If x < y,
,                             Form a 2-element array [x, y] and return
                            Else
                   <:         Decrement y
                AND           Perform bitwise-and on y and y-1, call it y'
          >:                  Increment x
        OR                    Perform bitwise-or on x and x+1, call it x'
    $:                        Call recursively on x' and y' and return

Nice answer! Sorry to change the challenge after you've posted an answer, but I've simplified the challenge a little bit. (you don't need to iterate over the list any more). That should let you shorten it a little bit more.

@DrGreenEggsandIronMan J is actually applying the function element-wise between the two arrays without any explicit ranking, which is nice. Unless there's another trick, it will probably stay the same.

Python, 42 bytes
f=lambda x,y:x<y and f(x|x+1,y&y-1)or(x,y)

Thanks to @jimmy23013 for golfing off 4 bytes! Thanks to @LeakyNun for golfing off 2 bytes!
Test it on Ideone.

Pyth, 29 27 25 22 21 20 19 18 16 bytes

MxG^2x_+\0.BG`HCm.W<FHgVZU2dC
MxG^2x_+0jG2HCm.W<FHgVZU2dC
Cm.W<FH.bxN^2x_+0jN2YZ2dC
m.W<FH.bxN^2x_+0jN2YZ2      <-- changed input/output format
m.W<FH.exb^2x_+0jb2kZ
m.W<FH.U,.|bhb.&ZtZZ
.W<FH.U,.|bhb.&ZtZZ         <-- changed input/output format
.W<FH.U,.|bhb.&ZtZ
.W<FH.U,.|bhb.&t

Test suite.

Sorry to change the challenge after you've posted an answer, but I've simplified the challenge a little bit. (you don't need to iterate over the list any more). Although thankfully that will allow you to shorten it.

@DrGreenEggsandIronMan It only saved one byte. Pyth is that efficient.

Mathematica, 46 bytes
If[#<#2,BitOr[#,#+1]~#0~BitAnd[#2,#2-1],{##}]&

Same method as used in my solution in J.
Thanks to @Martin for saving 1 byte and reminding me of infix application ~.
Usage
The input consists of two integer arguments and the output is a list with the bit-borrowed values.

Thought I'd try something funny, but unfortunately it's a byte longer: #//.{x_,y_}/;x<y:>{BitOr[x,x+1],BitAnd[y,y-1]}& (maybe you have an idea how to shorten it though)

That's a neat rule, but I'm not very familiar with golfing rules. I typically only use substitution /. and condition /;. Wish Mathematica could switch between boolean and bitwise by inspecting argument types to && and such.

05AB1E, 16 15 bytes
[D`›#`D<&sD>~s‚

Try it online

Labyrinth, 37 34 bytes
?"
}
|=:{:
)   }
: :;-{
=&( {!;\!@

Try it online!
Explanation
Quick Labyrinth primer:

Labyrinth operates on two stacks of arbitrary-precision integers, main and auxiliary, which are initially filled with an (implicit) infinite amount of zeros.
The source code resembles a maze, where the instruction pointer (IP) follows corridors. All interesting control flow happens at junctions: when the IP has more than one cell to go to, the top of the main stack is inspected. If the value is negative, the IP turns left, if it's positive, the IP turns right, and otherwise it moves straight ahead. If the chosen direction is blocked by a wall (i.e. a space), the IP moves in the opposite direction instead.

The program uses the same algorithm as the other answers: we replace (a, b) with (a | a+1, b & b-1) as long as a < b. I'll add a full explanation after I've tried golfing it some more.
The IP starts in the top left corner, going right. ? reads an integer a. Then " is a no-op, but it's necessary to prevent the IP from moving down immediately. This is also a dead end, so the IP turns around and executes ? again to read b. } then moves b from main to aux, so now we've got:
Main [ ... 0 a | b 0 ...] Aux

The | then does nothing, because it takes the bitwise OR of a and 0. Since we know a is always positive, the IP turns east (because it can't turn west). This begins the main loop of the program. We start with a short linear section in order to compare a and b:
=   Swap tops of stacks, i.e. swap a and b.
:   Duplicate b.
{   Pull a over to main.
:   Duplicate a.
}   Push one copy back to aux.
-   Compute b-a.

The IP is now at another junction. First, let's consider the case where the result is positive. That means b > a and we need to perform one more iteration. That iteration is also completely linear. Note that the stacks are currently:
Main [ ... 0 b (b-a) | a 0 ...] Aux

;   Discard b-a.
:   Duplicate b.
(   Decrement.
&   Bitwise AND with b, clearing the least-significant 1.
=   Swap new b with old a.
:   Duplicate a.
)   Increment.
|   Bitwise OR with a, setting the least-significant 0.

And then we're back to the start of the loop (since a is again positive, the IP turns east again).
If at some point b-a is no longer positive, the IP will take one of the other two paths. Note that in both cases we fetch a with {, then hit a corner where the IP follows the bend and then print a with !. Now the top of the stack is again b-a which means that in both cases the IP will end up moving east. All that's left is a short linear bit now:
;   Discard b-a.
\   Print a linefeed.
!   Print b.
@   Terminate the program.

Java 7, 73 bytes
void d(int x,int y){while(x<y){x|=x+1;y&=y-1;}System.out.print(x+","+y);}

Ungolfed & test cases:
Try it here.
public class Main{
  static void d(int x, int y){
    while(x < y){
      x |= x + 1;
      y &= y - 1;
    }
    System.out.print(x + "," + y);
  }

  public static void main(String[] a){
    print(2, 3);
    print(3, 2);
    print(8, 23);
    print(42, 81);
    print(38, 41);
    print(16, 73);
    print(17, 17);
  }

  public static void print(int a, int b){
    d(a, b);
    System.out.println();
  }
}

Output:
3,2
3,2
31,0
63,0
47,32
23,0
17,17

Old challenge rules [126 125 123 bytes]:
NOTE: The old challenge rules used two integer-arrays as input, instead of two loose integers.
void d(int[]a,int[]b){int i=-1,x,y;while(++i<a.length){x=a[i];y=b[i];for(;x<y;x|=x+1,y&=y-1);System.out.println(x+","+y);}}

Sorry to change the challenge after you've posted an answer, but I've simplified the challenge a little bit. (you don't need to iterate over the list any more). Although thankfully that will allow you to shorten it.

@DrGreenEggsandIronMan Edited. Btw, it's usually bad practice to change the rules after people have posted their answers.. But as you said, it should lower the byte-count, so I'm ok with it. (PS: You haven't made the comment above on everyone's answer.)

You can rewrite your while loop like this for(;x<y;x|=x+1,y&=y-1);

I know it is. -_- I wish I had written it better from the beginning. Thankfully it's not an unreasonable or drastic change. Also, yes I didn't comment on every answer, but I informed every user. I didn't feel like informing the same user multiple times. I didn't comment on Dennis's post, but that's because he was one of the users that encouraged me to change it initially.

Julia, 27 bytes
x<|y=x<y?x|-~x<|y&~-y:[x,y]

Try it online!
How it works
We define the binary operator <| for our purposes. It is undefined in recent versions of Julia, but still recognized as an operator by the parser. While \ (not explicitly defined for integers) is one byte shorter, its high precedence would require replacing x|-~x<|y&~-y with (x|-~x)\(y&~-y), thus increasing the byte count.
<| checks if its first argument is strictly less than the second one. If so, it recursively calls itself with arguments x | -~x = x | (x + 1) and y & ~-y = y & (y - 1).
Since adding 1 to x toggles all trailing set bits and the lowest unset bit, x | (x + 1) toggles the lowest unset bit (and no other bits). Likewise, since subtracting 1 from y toggles all trailing unset bits and the lowest set bit, y & (y + 1) toggles the lowest set bit.
Finally, when the inequality x < y no longer holds, <| returns the pair [x, y].

JavaScript (ES6), 33 bytes
f=(n,m)=>n<m?f(n|n+1,m&m-1):[n,m]

Simple port of the answers by @miles.

You forgot the f= ath the beginning :P

You forgot the "again" ;-)

MATLAB, 67 66 bytes
loop:
function[]=f(x,y)
while x<y
x=bitor(x,x+1);y=bitand(y,y-1);end
x,y

recursive (67 bytes):
function[]=f(x,y)
if x<y
f(bitor(x,x+1),bitand(y,y-1))
else
x,y
end

Same approach to changing bits as many other anwers.

Clojure, 63 bytes
#(if(< % %2)(recur(bit-or %(inc %))(bit-and %2(dec %2)))[% %2])

Same method as used in my solution in J.
Usage
=> (def f #(if(< % %2)(recur(bit-or %(inc %))(bit-and %2(dec %2)))[% %2]))
=> (f 38 41)
[47 32]
=> (map (partial apply f) [[2 3] [3 2] [8 23] [42 81] [38 41] [16 73] [17 17]])
([3 2] [3 2] [31 0] [63 0] [47 32] [23 0] [17 17])

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Does the triangle contain the origin?
Challenge description
On a Cartesian plane, a triangle can be described as a set of three points, each point being one of the triangle's vertices. For instance, coordinates (2, 1), (6, 8), (-7, 3) correspond to the following triangle:

As you can see, it does not contain the origin of the plane, i.e. the point (0, 0), unlike the triangle (-5, 3), (2, 7), (3, -8):

Your job is to write a program, that given exactly six integers describing coordinates of a triangle, determines whether or not it contains the origin of the Cartesian plane. The objective is to make your code as short as possible, since this is a code-golf challenge.
Input
Six integers corresponding to three coordinates of a triangle, for example:
1 4 -9 0 3 -4 -> (1, 4), (-9, 0), (3, -4)
You can also accept a list of integers, a list of two-tuples... - whatever is most convenient or makes your code shorter.
Output
A truthy value if the triangle contains the origin (1, True), falsy value otherwise (0, False). You don't need to validate the input.
Sample inputs / outputs
(18, -36), (36, 19), (-15, 9) -> True
(-23, 31), (-27, 40), (32, 22) -> False
(-40, -34), (35, 20), (47, 27) -> False
(0, 6), (-36, -42), (12, -34) -> True
(-24, 6), (36, 6), (-14, -25) -> True

Triangle images courtesy of Wolfram Alpha

Well-written challenge, but we already have it.

Well, that's a shame... should've searched more thoroughly for duplicates. I'm just gonna leave it like this, worst-case scenario it will get deleted by mods.

Your challenge won't be deleted. It's closed, which disables answering it but keeps it visible.


text:
Lithp Tranthlator
My friend made a lisp translator the other day, that is to say it took a string and converted s=>th and S=>Th. It was quite long and I thought that it could be golfed.
So the task is to make a program/function that takes an input string, translates it in to lisp and outputs the string
Test case
Sam and Sally like Sheep        Tham and Thally like Thheep
Sally likes sausages            Thally liketh thauthageth
Sally sells seashells           Thally thellth theathhellth

Note that it doesn't matter that h gets repeated all the time
This is code golf so shortest answer wins

I wished everyone would change the bytes in their headers to byteth.

May someone show this challenge to Mike Tyson?

There should be bonus points if the program doesn't use s nor S anywhere in it.

@NateDiamond great idea, but too late for that, i'm afraid.

Thufferin' thuccotathh!

I think the language names should be made clear. Without the replacement. Some languages contain "th" already, so it's ambiguous. And who's to say that someone won't create a different language actually called "Common Lithp" in the future?

@mbomb007 I wouldn't worry about it too much. I'm not sure if there is actually a default way to title your answer. Most question I see if they do state how to do it it is normally the same way. As I haven't explain how the answer should be set out, then users are free to title them how they want to. Being a pedant, I didn't even ask for a language, so I could argue against them even writing them. But I do understand your point. I just don't think it is of concern

A thing that would have made this challenge more interesting would be overall case preservation, e.g. LOOK OUT A SNAKE!!! -> LOOK OUT A THNAKE!!!

@fluffy after writing the question I did realise a case like that would fail, but it is too late to change now

Welcome to Programming Puzzleth & Code Golf! That Ith a Good quethtion and thothe help the community a lot!

Common Lithp, 62
(map()(lambda(u)(princ(case u(#\s"th")(#\S"Th")(t u))))(read))

First, (read) the input (it should be a string).
Strings in CL are sequences so we use map to iterate on each character. The first argument to map represents the type of the result (e.g. I could build a list from a vector). When it is nil, a.k.a. (), results are discarded. The function that is mapped to the input simply princ (print non-readably) each character, except the ones that should be replaced.

That language name though.

@JoeZ. I just replaced the s by th, like everybody else did: look at those Pyson answers.

@coredump They're all wrong: it's one-way: s->th, S->Th, th->th, Th->Th.

I think thith ith invalid. You want cathe u(#\s"th") inthtead.

@DrGreenEggsandIronMan Sure,  (defmacro cathe (&rest args) \(case ,@args))`

umm What is Common lithp

@Matthew Not sure if you are joking or not, but  Common Lisp is a language and Common Lithp is a pun based on the question. BTW, when I first read the question, I imagined it was about the programming language.

Ok lol that makes more sense

Retina, 9 bytes
S
Th
s
th

Try it online!
The obvious answer.

JavaThcript ETh6, 38 bytes
At first I went with the obvious solution
a=>a.replace(/s/g,'th').replace(/S/g,'Th')

But I golfed it down 4 bytes
a=>a.replace(/s/gi,b=>b>'r'?'th':'Th')

This makes use of the regex i flag, which searches for case-insensitive patterns. The good thing about Javascript is that you can specify an anonymous function to handle (regex) replacing.
Try it here

f=
a=>a.replace(/s/gi,b=>b>'r'?'th':'Th')

s.innerHTML = [
    'abScdsefSghsij',
    'Sam and Sally like Sheep',
    'Sally likes sausages',
    'Sally sells seashells'
].map(c=>c + ' => ' + f(c)).join`<br>`
<pre id=s>

"E eth thickth"?

I was thinking in 'Tt'[b>'r']+'h', but it is the same length

You mean 38 byteth

+1 for TIL that string comparison is done via Code Point Value

@Upgoat That was my fault sorry.

¡ʇɐoƃ 'ıH lolol

GNU Sed - 17
s/S/Th/g;s/s/th/g

The obvious answer.
$ sed -e "s/S/Th/g;s/s/th/g"

Sam and Sally like Sheep
Tham and Thally like Thheep

Sally likes sausages
Thally liketh thauthageth

Sally sells seashells
Thally thellth theathhellth

Did you mean GNU Thed? ;)

Jelly, 13 bytes
“Ss”,“Th“th”y

Thhowing off Jelly'th thhiny new tranthlate atom. Try it online!

Python 3 - 40 byteth
First golfing!
lambda s:s.translate({115:'th',83:'Th'})

It uses the str module's translate method which accepts a translation table. The translation table is a simple dict with keycode as keys and the str in place of it as value.

Welcome to the PP&CG community!

Can I ask you, why you have 2 separate accounts?

@Bálint Apparently, he forgot to log into his current account with only 3 rep, but an experience on [so]. And posted with a new account.

05AB1E, 14 12 bytes
's„th:'S„Th:

The straight forward answer.
Try it online
Saved 2 bytes thanks to @Adnan

Isn't this the thtraight forward anthwer rather than the straight forward answer?

JavaThcript ETh6, 43 byteth
s=>s.replace(/s/gi,m=>({s:'th',S:'Th'})[m])

Tetht Thuite:

th=s=>s.replace(/s/gi,m=>({s:'th',S:'Th'})[m])

console.log(th('Sam and Sally like Sheep'));
console.log(th('Sally likes sausages'));
console.log(th('Sally sells seashells'));

Confethth: thou only wroteth that tetht thuite for the thake of itth title!

V, 11 byteth
Ís/th
ÍS/Th

Try it online!
V ith a language I made. It'th not finithed, but it'th really good at regekth.

C, 50 bytes
s(c){c=getchar();c+=c-83&95?0:'h\1';s(printf(&c));}

Replace \1 with an actual \x01 byte.
jimmy23013 saved a byte, and then I saved two more using his approach! Thanks.

I was about to comment that the &c parameter is broken. But it's not, because on a little-endian architecture the second byte of that int will be 0x00 and actually terminate the "string"... This is horribly clever, I love it !

s(c){c=getchar();c+=c-83&~32?0:26625;s(printf(&c));}

You can't push 2 bytes into a char. 'h\1'

@EʀɪᴋᴛʜᴇGᴏʟғᴇʀ Multi-character constants are implementation defined, bu perfectly valid C.

Java, 71 65 bytes
String t(String s){return s.replace("S","Th").replace("s","th");}

First attempt at golfing, so why not with Java.

You can use replace instead of replaceAll

Oh, yeah you're right. Thanks! @aditsu

You can save some bytes by using a lambda expression instead of a function. s->s.replace("S","Th").replace("s","th")

TI-Basic, 126 bytes
Input Str1
inString(Str1,"s
While Ans
sub(Str1,1,Ans-1)+"th"+sub(Str1,Ans+1,length(Str1)-Ans->Str1
inString(Str1,"s
End
inString(Str1,"S
While Ans
sub(Str1,1,Ans-1)+"Th"+sub(Str1,Ans+1,length(Str1)-Ans->Str1
inString(Str1,"S
End
Str1

This is wrong. Str1 never changes, and Ans will hold a number at the end.

Thanks for the note, fixed now. I don't know how I forgot to save Str1 back again...

This is still wrong; it errors when the first or last character is S. As I've said before, please test your code before you post it.

Java, 101 byteth
interface a{static void main(String[]A){System.out.print(A[0].replace("S","Th").replace("s","th"));}}

Note that this is a complete program unlike the previous Java answer.
Bonus (has to be fed to the C preprocessor THEE preprothethor first):
#define interfaith interface
#define thtatic static
#define Thtring String
#define Thythtem System
#define replaith(x,y) replace(x,y)

interfaith a{thtatic void main(Thtring[]A){Thythtem.out.print(A[0].replaith("S","Th").replaith("s","th"));}}

GNU AWK, 31 bytes
Just using gsub function to translate lower or upper S via regex and print it afterwards.  Can work with files, or with stdin as in this case
$ awk '{gsub(/s/,"th");gsub(/S/,"Th")}1' <<< "This is Sparta"
Thith ith Thparta

gsub(/s/,"th")gsub(/S/,"Th") does the trick.

35 Byteth of Julia:
s->replace(s,r"s"i,s->"$(s[1]+1)h")

Try it online! (includes all test cases)

Hey, don't I know you from somewhere? ;)

C (GCC), 62 byteth
-10 bytes thanks to @ceilingcat; forgot to use the function argument as the iterator.
-1 more byte thanks to @l4m2 and his very smart recursion trick.
l(char*s){*s&&l(s+!!putchar(*s&31^19?*s:104+!putchar(*s+1)));}

Try It Online!
Explanation:
l(char*s)
{
    // If at end of string, do nothing.
    *s&&
        // Else, apply this function to the next character in s ...
        l(s+
            // ... but first, print the current character. If the first
            // five bits of *s equal 19 (which they do for 's' and
            // 'S'), print *s+1 (that is, 't' for 's' and 'T' for 'S')
            // before printing character code 104, which is 'h'.
            // If the first five bits aren't 19, just print *s.
            !!putchar(*s&31^19?*s:104+!putchar(*s+1)));}

Alternative 62-byte version, made by l4m2:
l(char*s){*s&&l(s+!!printf(*s&31^19?"%c":*s%5?"Th":"th",*s));}

Try it online!
I'm too lazy to explain that one fully, but it's quite similar to the last one except it uses two nested conditional statements to figure out if it should print the current character, Th or th. The new *s%5 check is used to figure out if *s is 'S' or 's' (knowing that it's one of those), since the ASCII code of s is divisible by 5 but 'S' is not.

62

@l4m2 That's very clever, thanks a lot :)

Alternative 62

Python3 - 46 bytes
lambda s:s.replace("s","th").replace("S","Th")

Dropped 4 bytes with the help of @DenkerAffe!

Python 3 was the language it was originally written in. My version of his code was 59 bytes, so we'll done!

lambda s:s.replace("s","th").replace("S","Th") is a bit shorter.

@DenkerAffe Yes it is shorter but to use lambda in this case, you would still need an input and an output to answer the original question.

@george Community consensus is that functions can use arguments and returns values instead of using stdin/stdout. Have a look at our defaults for I/O. While you can of course override them if you want, it wouldn't make much sense in this particular challenge.

@DenkerAffe okay that's fine. When I asked the question I mean the output would be an echo or print. But I shall leave it to the defaults. So yes using lambda would be shorter

CJam, 15 bytes
q"sS""thTh"2/er

Test it here.
Explanation
q      e# Read input.
"sS"   e# Push string.
"thTh" e# Push string.
2/     e# Split into pairs, i.e. ["th" "Th"].
er     e# Transliteration, replaces 's' with 'th' and 'S' with 'Th'.

Haskell, 36 bytes
f 's'="th";f 'S'="Th";f x=[x]
(>>=f)

You don't need the space: f's'=...

Sadly, I do. Haskell names may contain apostrophes. :(

Oh damn I completely forgot that. I almost never need Chars...

I thought it wath "Hathkell"

PHP, 42 Bytes
if run from a file:
<?=strtr($argv[1],["s"=>"th","S"=>"Th"]);

Run as:
~$ php [file] "This is Silly"

-1 byte: remove the newline at the end

-8 bytes: remove quotes. -> use php -d error_reporting=0 to suppress notices.

Rust, 46 bytes
|s:&str|s.replace("s","th").replace("S","Th");

Try it online!

@mbomb007. I'm not sure you should edit that.

I'm making it follow the answering guidelines. I should be able to view a post and know what language it is. Some languages contain "th" already, so it's ambiguous. And who's to say that someone won't create a different language actually called "Rutht" in the future?

@mbomb007, who's to say someone won't create a different language called "Rust" in the future?

@msh210 Moot point, because if used the poster will need to clarify.

Befunge 98, 37 49 bytes
Original version :
~:"s"- #v_$"ht",>,
_;#-"S":<;$"hT",^

Terminating edition, as per consensus :
~:a-!#@_:"s"-#v_$"ht",>,
_;#-"S":      <;$"hT",^

This leaves a big honking hole in the code grid that I'm not very happy about. I'll look into that when I have the time.
The 49th byte is a space at the end of the second line, included to have a rectangular grid, required to prevent ccbi (and probably other interpreters) from bugging out and printing an infinite line of "Th"s.

Emacth Lithp, 61 byteth
(lambda(s)(replace-regexp-in-string"[Ss]\\(\\w*\\)""th\\1"s))

Emacs Lisp tries to be smart when replacing text, but that smartness breaks when the replaced string only takes up one space, i.e. the capital letter S. To prevent this from converting "Sam and Sally" to "THam and THally", the whole word is matched instead. However, this also handles "SAM and Sally" in the way that one would want, i.e. producing "THAM and Thally".

x86 machine code, 19 bytes
In hex:
86ac3c5374043c73750440aab068aa84c075eec3

Input: ESI: input string, EDI: output buffer.
Disassembly:
_loop:
0:  ac          lodsb
1:  3c 53       cmp al,'S'
3:  74 04       je _th
5:  3c 73       cmp al,'s'
7:  75 04       jne _nth
_th:
9:  40          inc eax     ;[Ss]->[Tt]
a:  aa          stosb
b:  b0 68       mov al,'h'
_nth:
d:  aa          stosb
e:  84 c0       test al,al
10: 75 ee       jnz _loop
12: c3          ret

You can use test al, 'S' to check both at once

Vyxal s, 11 bytes
ƛ⇩\s=[‛th$•

Try it Online!
I wath hoping I could find thomething lethth trivial than jutht replacing the letter with the combo but I couldn't. Lookth like I did.
Explained
ƛ⇩\s=[‛th$•
ƛ             # To each character:
 ⇩\s=[        #   if char.lower == "s":
      ‛th$•   #     "th" with the capitalisation of the character

C# 6.0 - 58 bytes
string f(string s)=>s.Replace("s","th").Replace("S","Th");

Takes the input string as an argument to the function.

Pyth, 14 bytes
::z\s"th"\S"Th

Test suite
Thanks to @LeakyNun for spotting a typo!

So the language is "Pys"? :P

MATL, 17 bytes
115'th'YX83'Th'YX

Try it online!
Explanation
115    % 's' (ASCII)
'th'   % String 'th'
YX     % Regex replacement
83     % 'S' (ASCII)
'Th'   % String 'Th'
YX     % Regex replacement

Python 3, 53 bytes
def l(s):return s.replace("s","th").replace("S","Th")

Usage:
>> l('Sam and Sally like Sheep')

Tham and Thally like Thheep

-7 bytes: lambda s:s.replace("s","th").replace("S","Th") Usage: (lambda s:s.replace("s","th").replace("S","Th"))(s)

@EʀɪᴋᴛʜᴇGᴏʟғᴇʀ Well, that's identical to TuukkaX's answer (which was posted before mine), so...

There's no reason to post another answer then.

@EʀɪᴋᴛʜᴇGᴏʟғᴇʀ I didn't notice his when I posted mine.

You can delete your answer once you notice there is a shorter one posted before yours.

GameMaker Language, 74 bytes
return string_replace_all(string_replace_all(argument0,'s','th'),'S','Th')

Matlab, 39 byteth
A straitforward approach:
@(t)strrep(strrep(t,'s','th'),'S','Th')

s-lang, 16 15 8 bytes (non-competing)
Saved one byte because s-lang no longer requires last argument bracket
Saved seven bytes because of ! paramater
Try it online!
t![s][th

s-lang (or, th-lang) is a string manipulation language I am working on for fun.
I am still optimizing argument brackets...
Explantion

t replace function with search argument and replace argument.
! "preserve case" parameter
[s] the first search argument (searches for the character "s")
[th the first replace argument (now this will replace each "s" with a "th"). End bracket is omitted because it is unnecessary.

Doesn't p parameter need +1 byte?

@EʀɪᴋᴛʜᴇGᴏʟғᴇʀ Oh.. it is now "!" instead of "!". I'll fix that

Brainfuck, 235 byteth
(Newlines included only for readability)
,[[>+>+>+<<<-]>>>>-[>+<---]>--[-<<->>]+<<[>>-<<[-]]>>[>-[--->+<]>-.[---->+++++<]>-.<<<-]>>>>
[-]<[>+<[-]]+>[<->-]<[<<<<<-[>++<+++++++++]>+[-<<->>]+<<[>>-<<[-]]>>[>--------[-->+++<]>.---
---------.>]<>[-]<[>+<[-]]+>[<->-]<[<<.>]]>>>>>>>,]

Requires 8-bit cells, and 0 on EOF. Try it online! I thought I could golf tt using some "if = s OR = S" wizardry, but it turns out that this just confounds the system.
Readable
,
[
 [>+>+>+<<<-]>>>
 >-[>+<---]>--
 [-<<->>]+<<[>>-<<[-]]>>
 [ if char = "S"
  >-[--->+<]>-.[---->+++++<]>-.<<<-  output Th
 ]
 >>>

 >[-]
 <[>+<[-]]+
 >[<->-]<    logical negation

 [ else
  <<<<<
  -[>++<+++++++++]>+
  [-<<->>]+<<[>>-<<[-]]>>

   [ if char = "s"
    >--------[-->+++<]>.------------.>  output th
   ]

  <

  >[-]
  <[>+<[-]]+
  >[<->-]<    logical negation

  [<<.>] otherwise output and move to zero cell
 ]
 >>>>>>> we're going to move over some so we can use new cells
 , take more input
]

Javathcript, 27 Byteth
b=a=>a.replace(/s/gi,'th');

Although it is case insensitive it is the smallest JS version so far :)

Arturo, 30 29 byteth
$=>[translate&#[S:"Th"s:'th]]

Try it

Lexurgy, 18 byteth
s:
{S,s}=>{Th,th}

SpecBAS ThpecBATh - 53 bytes
1 INPUT a$: ?REPLACE$(REPLACE$(a$,"S","Th"),"s","th")

Matlab, 38 42 bytes
@(t)regexprep(t,{'s','S'},{'th','Th'})

Shout out to @LuisMendo for the tip about cell arrays!
For 'Miss Sissy' yields ans = Mithth Thiththy.

I think straightforward approach is shorter: http://codegolf.stackexchange.com/a/83190/55372

You can use a single call to regexprep with cell arrays: @(t)regexprep(t,{'s' 'S'},{'th' 'Th'}), 38 bytes

@LuisMendo I had had problems using cell arrays in regexprep before, but they seem to have straightened that out. Edited!

Thue, Full program: 27 byteth, function: 13 byteth
s::=th
S::=Th

Thince Thue can read input, a correct input routine will be too long. Tho i potht it ath a "function"
EDIT: I have forgotten, Thue read lineth from thtdin, not characterth
Tho, here ith a full program:
s::=th
S::=Th
I::=:::
::=
I

Is the language Thue or Sue?

@DerpfacePython The tranthformationth are only s => th and S => Th, tho it'th Thue.

Ah, I underthtand now. Thankth!

PowerThhell, 41 bytes
$args.replace('S','Th').replace('s','th')

I can't beat this simple approach; there is a string.translate buried in XPath and there are map style approaches in the Linq library - but they're wordy. Can't easily do a dictionary lookup per character because PS is case insensitive and thinks 's' and 'S' are duplicate keys.
Best novelty alternative so far:
$OFS='Th';''+$args.split('S')-replace's','th'

Perl 5, 18 byteth
The obviouth anthwer; I don't thee anything thhorter. 17 byteth, pluth 1 for -pe inthtead of -e.
s/s/th/g;s/S/Th/g

I wathn't thure whether, tho ath to follow the thandard for anthwerth of thith quethtion, I thhould lithpify my code ath well ath my prothe. Jutht in cathe, here'th the lithpy verthion:
th/th/th/g;th/Th/Th/g

J, 38 bytes
load'strings'
rplc&('s';'th';'S';'Th')

In J, rplc is the string replace verb in the strings addon, and it takes a list of boxes where each pair [x, y] represents the string x to be replaced with y.
Usage
   f =: rplc&('s';'th';'S';'Th')
   f 'Sam and Sally like Sheep'
Tham and Thally like Thheep
   f 'Sally likes sausages'
Thally liketh thauthageth
   f 'Sally sells seashells'
Thally thellth theathhellth

C, 101 bytes
Note this is a complete C program, unlike the previous C answer.
It takes the first command line argument as input. Compile w/ gcc and run ./a.out "Sally sells seashells"
#include<stdio.h>
main(int d,char**c){for(d=**++c;d;putchar(d&223^83?d:d+(*0[c]--=104,1)),d=*++*c);}

Hello, and welcome  to PPCG!

Erm, whether the program is complete doesn't matter. On PPCG we accept both full programs and functions.

C, 69 byteth
Reads from stdin, writes to stdout. Nothing terrific, but somebody had to do it!
c;main(){while((c=getchar())>0)printf(c-'s'?c-'S'?"%c":"Th":"th",c);}

J, 47 bytes
Without using the strings library.
[:;(]`('h',~[:u:1+3&u:)@.([:+/'sS'-:"0]))&.>@;/

Thilicon, 13 byteth
i`s|th``S|Th`

Pretty simple. i to get input, and the rest of it is replacing stuff. Output is implicit.

Go, 87 bytes
import."strings"
func f(s string)string{R:=ReplaceAll
return R(R(s,"s","th"),"S","Th")}

Attempt This Online!

Thunno, \$ 16 \log_{256}(96) \approx \$ 13.17 bytes
's"th"AR'S"Th"AR

Attempt This Online!
Obviouth anthwer.
Explanation
's"th"AR'S"Th"AR  # Implicit input
's                # Character 's'
  "th"            # String "th"
      AR          # Replace
        'S        # Character 'S'
          "Th"    # String "Th"
              AR  # Replace
                  # Implicit output

Thunno 2, 11 bytes
`Ss"Thth"½Ṇ

Try it online!
Explanation
`Ss"Thth"½Ṇ  # Implicit input
`Ss          # Push "Ss"
   "Thth"    # Push "Thth"
         ½   # Halve it
          Ṇ  # Transliterate
             # Implicit output

K (ngn/k), 18 bytes
"Th"/"S"\"th"/"s"\

Try it online!

"s"\ split (implicit) input on "s"s
"th"/ join with "th"
"S"\ split on "S"s
"Th"/ join with "Th"

Pyke, 14 byteth
\s"th":\S"Th":

Try it here!
Thith anthwer ith very thimple and boring.

TCC - 28 bytes
=SO;i;{'s';'th';{'S';'Th';SO

Try it online!
Explanation:
=SO;i;                       - Load input (i) into SO (string operations)
      {'s';'th';             - Replace 's' with 'th' in SO
                {'S';'Th';   - Replace 'S' with 'Th' in SO
                          SO - Implicit print of SO

Rattle, 50 byteth
\&Th&th|Ig0Ig0I^P3[g["S"b1]["s"b2][^"S"[^"s"b]]>]`

Try it Online!
Explanation
\&Th&th|                          pass [(user input), "Th", "th"] to program
        I                         place list items in consecutive memory slots, move pointer to next free slot
         g0                       get item 0 (user input)
           I                      place list items in consecutive memory slots, move pointer to next free slot
            g0                    get item 0 (user input)
              I^                  set top of stack to the length of this item
                P3                move the pointer to slot 3

[ ... ]`                          loop n times, where n is the top of the stack

g                                 get the value at the pointer
 ["S"  ]                          if the value is "S",
     b1                           add the item in storage at pointer 1 ("Th") to print buffer
        ["s"  ]                   if the value is "s",
            b2                    add the item in storage at pointer 2 ("th") to print buffer
               [^"S"       ]      if the value is not "S",
                    [^"s" ]       if the value is not "s",
                         b        add the item to the print buffer
                            >     move the pointer right
                                  the buffer is printed implicitly

Rattle, 50 byteth
Here's an alternative approach using ASCII values that turned out to be the same byte count:
\&Th&th|Ig0Ig0I^P3[gn[83b1][115b2][^83[^115gb]]>]`

Try it Online!

Raku, 23 bytes
*.trans(<s S>=><th Th>)

Try it online!
Just calls the built-in string translate function.

Racketh -- 58 bytes
#!racket
(regexp-replaces(read-line)'(["s""th"]["S""Th"]))

Try it online!

Explanation
On line one we have the required language expression for Racket.
On line two we pass user input to a function that uses regular expressions to replace certain characters ("s" becomes "th" and "S" becomes "Th").
#lang racket
(regexp-replaces (read-line) '(["s" "th"] ["S" "Th"]))

sed 4.2.2, 17 bytes
s/s/th/g
s/S/Th/g

Try it online!
Pretty thimple. It'th what thed it made for.

05AB1E, 11 10 byteth
„sS„thD™‚‡

Originally thuggethted ath a golf for the exithting 05AB1E anthwer, but I decided to potht it ath a theparated anthwer after there wath no rethpondth for halve a year. :)
Try it online.
Explanation:
„sS         # Push string "sS"
   „th      # Push string "th"
      D     # Duplicate it
       ™    # Titlecase the copy
        ‚   # Pair the two together: ["th","Th"]
         ‡  # Transliterate all "s" to "th" and "S" to "Th" in the (implicit) input
            # (after which the result is output implicitly)

PTh: Altho workth in 2thable:
Try it online (Hello. Table for two, pleathe. ;p)

brainfuck, 183 byteth
-[>+<---]>-->>>+[->-[<]>--]>-<<<+[-->++[<]>-]>+<<,[[-<+<+<+>>>]>>[<<+<->>>-]<<[->>+<<]+<[[-]>-<<<<[->>->+<<<]>>>[-<<<+>>>]+<[<.>>-]>[<<+.>>->>>>.<<<]]>[<<<+.>>>->>>.<<]<<<[-]<[-]>>>,]

Try it online!
Explanation
[
* https://esolangs.org/wiki/Brainfuck_constants
* https://esolangs.org/wiki/Brainfuck_algorithms
*
* Cell #    Name    Explanation
* 0         tc0     Unused except right at the start for making 83 ('S')
* 1         tc1     Stores 'S'
* 2         tc1p5   Temp cell & used for outputting input char
* 3         tc2     Temp cell & holds input char - 'S'
* 4         tc3     Temp cell & holds input char - 's'
* 5         tc4     Temp cell & input initially starts here
* 6         tc4p5   Temp cell
* 7         tc5     Stores 's'
* 8         tc6     Stores 'h'
*
* Algorithm:
*   initialization
*
*   while (ch = input()) {
*       if ((ch - 's') != 0) {
*           if ((ch - 'S') != 0) {
*               output(ch)
*           } else {
*               output(ch + 1)
*               output('h')
*           }
*       } else {
*           output(ch + 1)
*           output('h')
*       }
*   }
]

-[>+<---]>-- make 83 ('S') on tc1 end tc1

>> make space for tc1p5 and tc4p5

>+[->-[<]>--]>- make 104 ('h') on tc6 end tc6
<<<+[-->++[<]>-]>+ make 115 ('s') on tc5 end tc5

<<,[ tc4 begin input loop

handling:
    'S': output Th
    's': output th
    else: output char

[-<+<+<+>>>] copy tc4 to tc3 tc2 tc1p5 end tc4

>> tc5 s
[<<+<->>>-] move tc5 to tc4 and sub from tc3 end tc5
<<[->>+<<] tc4 move back to tc5 end tc4

+ tc4 is 1
<[
    tc3 is not 's'
    [-] zero tc3
    >-< tc4 to zero

    <<< tc1
    [->>->+<<<] tc1 to sub tc2 and add tc3 end tc1
    >>>[-<<<+>>>] tc3 to tc1 end tc3

    + tc3 one
    <[
        tc2 is not 'S'
        <. output tc1p5

        > tc2
        >-
    ]>
    [<
        tc2 is 'S'
        <+. tc1p5 output 'T'
        >>->>>>. tc6 output 'h' and dec tc3 along the way

        <<< tc4
    ] end tc4

]>
[< tc3 and tc3 is 's'
    <<+. tc1p5 make 't' output
    >>>->>>. tc6 output 'h' and dec tc4 along the way
    << tc4p5
] end tc4p5  tc4 0 tc4p5 0

<<<[-] tc2 zero
<[-] tc1p5 zero

>>> tc4

,] end tc4

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Rotate a hypercube
Introduction
A hypercube/tesseract is the 4 dimensional equivalent of a normal cube. It's made by taking a cube net, extending it to the 3rd dimension, then – using the 4th dimension – folding it into a hypercube. It's basically a cube, where each side is a cube.
To create a hypercube, you need 16 4d vectors (a vector with an x, a y, a z and a w component). These vectors are the following:
A(0, 0, 0, 0); B(1, 0, 0, 0); C(1, 0, 1, 0); D(0, 0, 1, 0); E(0, 1, 0, 0); F(1, 1, 0, 0); G(1, 1, 1, 0); H(0, 1, 1, 0);
I(0, 0, 0, 1); J(1, 0, 0, 1); K(1, 0, 1, 1); L(0, 0, 1, 1); M(0, 1, 0, 1); N(1, 1, 0, 1); O(1, 1, 1, 1); P(0, 1, 1, 1);

The hypercube has 24 faces. The following list contains all of them (every group marks a quad):
ABFE, CDHG, BCGF, DAEH, DCBA, FEHG
IJNM, KLPO, JKON, LIMP, LKJI, PMNO
ABJI, DCKL, BCKJ, DAIL, FEMN, GHPO, FGON, EHPM, EAIM, BFNJ, CGOK, HDLP

With all this information, you technically have a hypercube in code. To rotate this, you need 6 different matrices for each rotational plane, one for the YZ, XZ, XY, XW, YW and ZW planes. After you have every matrix, you need to multiply the cube's vertices with them.
The following images show the structure of each matrix:
For the rotation on the YZ plane:

For the rotation on the XZ plane:

For the rotation on the XY plane:

For the rotation on the XW plane:

For the rotation on the YW plane:

For the rotation on the ZW plane:

The rotations get applied in this order.
After all this, you have a rotated hypercube. Now you need to draw it. You should use an orthogonal projection combined with a perspective projection to send (x, y, z, w) to (2x/(2+z), 2y/(2+z)).
Input
Your input is 6 integers between 0 (inclusively) and 360 (exclusively). These represent the rotations in degrees on the different rotational planes of the hypercube.
Output
Your output should be a single image containing the hypercube. The display can be a rasterized image, a vector image or an ASCII art. The output image should be at least 100 * 100 pixels, and the cube needs to take up at least 50% of the screen. Any default image output format is allowed.
Test cases
0 0 0 0 0 0

0 0 0 0 0 30

30 0 0 0 0 30

0 0 0 30 30 30

45 45 45 0 0 0

45 45 45 45 45 45

Open the images in a new tab, to see them in full size.
Rules

Default rules apply
Standard loopholes are forbidden
Shortest code in bytes wins

Why did you nuke the other post?

@EᴀsᴛᴇʀʟʏIʀᴋ I posted it in the chat for a last review

@Bálint oh okay.

As I've pointed out on two separate occasions in the sandbox, the description of projection for display is incomplete because it assumes that the object to be projected is 3-dimensional whereas it is in fact, obviously, 4-dimensional.

@PeterTaylor Maybe it's an orthogonal projection into 3 dimensions followed by a perspective projection into 2? :/

@Blue The projection is not the main part of the challenge, you simply use the x and y positions of the vertex, to draw it on the screen.

Trippy. I like the output when all the rotations are 45 degrees.

If @Bálint confirms @beaker’s comment, I’ll vote to reopen

@Lynn I confirm

@Lynn & Bálint, I think it would be more challenging to require ([x,y]/z)/w.

@beaker The challenge is not about the projection

The face IJUM on the second line, what's U?

@luserdroog I think the 'U' must be 'N'.

Not a big deal, buf: the example XZ rotation matrix has a few lower-case thetas that look odd with all the capital ones around them.

"basically a cube, where each side is a cube.", that describes a 3d shape.

@AshwinGupta no, the sides of a 3d cube are squares, i.e. 2d shapes, polygons. A cube the sides of which are cubes is an effort to somehow convey this inherently unimaginable object, relating a bit to common sense. At least you can imagine the topology by fusing cubes to the faces of a cube in 3d...

@AndrasDeak ok I suppose I get what you are saying. It's just hard to conceptualize a shape since we can only understand up to 3D as humans.

@Bálint Thanks for the challenge, I enjoyed it. Hopefully we'll get more answers and different approaches. :D

Okay, this may be sort of a dumb question, but what do Big-O and Theta stand for in the matrices?

@R.Kap the big "O" is the big theta, I just messed up the formatting where there's a small theta. They mean the angle on that plane.

The list of faces includes IJUM but there is no U vector. What is that supposed to be?

@user1472751 fixed

Octave, 474 433 429 bytes
function H(a,b,c,d,e,f) C=@cosd;S=@sind;R=[1,0,0,0;0,C(e),0,-S(e);0,-S(e)*S(f),C(f),-C(e)*S(f);0,S(e)*C(f),S(f),C(e)*C(f)]*[C(c)*C(d),-S(c)*C(d),0,S(d);S(c),C(c),0,0;0,0,1,0;-C(c)*S(d),S(c)*S(d),0,C(d)]*[C(b),S(a)*S(b),C(a)*S(b),0;0,C(a),-S(a),0;-S(b),S(a)*C(b),C(a)*C(b),0;0,0,0,1]*(dec2bin(0:15)'-48.5);Z=R(3,:)+2;R=2*R./Z;Q=[1,2,10,12,11,9,10,14,16,12,4,8,16,15,11,3,7,15,13,9,1,5,13,14,6,8,7,5,6,2,4,3,1];plot(R(1,Q),R(2,Q));

Rotated:
function H(a,b,c,d,e,f)
C=@cosd;S=@sind;
R=[1,0,0,0;0,C(e),0,-S(e);0,-S(e)*S(f),C(f),-C(e)*S(f);0,S(e)*C(f),S(f),C(e)*C(f)]*
  [C(c)*C(d),-S(c)*C(d),0,S(d);S(c),C(c),0,0;0,0,1,0;-C(c)*S(d),S(c)*S(d),0,C(d)]*
  [C(b),S(a)*S(b),C(a)*S(b),0;0,C(a),-S(a),0;-S(b),S(a)*C(b),C(a)*C(b),0;0,0,0,1]*
  (dec2bin(0:15)'-48.5);
Z=R(3,:)+2;
R=2*R./Z;
Q=[1,2,10,12,11,9,10,14,16,12,4,8,16,15,11,3,7,15,13,9,1,5,13,14,6,8,7,5,6,2,4,3,1];
plot(R(1,Q),R(2,Q));

The rotation matrices still consume a lot of bytes, but the Eulerian cycle worked out quite well, reducing the number of vertices visited from 96 120 down to 33.
Vertices are generated by taking the 4-bit binary representation of [0:15] and considering the msb to be the x-coordinate and the lsb the w-coordinate.
Edit: Pre-multiplying all of the rotation matrices was a nightmare, which is why I didn't use it initially, but pre-multiplying them in pairs saved 41 bytes. Now to look for the optimum combination. :) Multiplying the matrices by threes was worse than no pre-multiplication at all, so I'll be happy with the pair-wise approach.

Output:
H(0,0,0,0,0,0)

H(0,0,0,0,0,30)

H(30,0,0,0,0,30)

H(0,0,0,30,30,30)

H(45,45,45,0,0,0)

H(45,45,45,45,45,45)

Edit: I'm stupid. fooled by the same variable everywhere... [Are you sure you don't want the full pre-multiplied matrix? :) https://i.imgur.com/nkM6y6g.png]

@algmyr Yeah, the fully multiplied matrix came out about twice as long, if I remember correctly.

This should be more like it, enjoy Maxima's stupid "simplifications": https://i.imgur.com/klkXLPf.png

To make up for failing miserable at math, here is a more golfed version of your code, 330 bytes: https://paste.ee/p/2GRyJ

Postscript 1075 732 683 640 631 601 590 545 542 526 514 478 470
Uses mat.ps and G.
Edit:-343 Applied binary-encoding generation of vectors and Eulerian circuit stolen borrowed from other answers. And applied binary-token-strings from the G library.
Edit:-49 Redefined sin cos and neg to shorter names.
Edit:-43 Defined short names for sequences 0 0 0 1 1 0.
Edit:-9 al (ie. aload) is shorter than (")@. Factored 3 calls to idi (ie. idiv) at the cost of a do-nothing 1 idiv.
Edit:-30 Applied implicit definition block from G.
Edit:-10 A few more triply-used sequences.
Edit:-45 Remove variables i j k l m n for the angles and always define the current angle as t and functions of angles use the value of the (global) t variable. Defer execution of the code-description of the rotation matrix until its t value is ready.
Edit:-3 Remove <16>$ ie. closepath. And a space.
Edit:-16 Factor-out array brackets from unit vectors in the rotation matrices (J K L and M). Re-apply dropped mo for mod and su for sub.
Edit:-12 In-line the project-and-draw function and remove (now empty) enclosing dictionary.
Edit:-36 Encoded the circuit (ie. the faces) in a string.
Edit:-8 Remove definition of vertices array V. Instead, leave on stack and dup working copies as needed (once, at first, and again at the end of the loop). Also, translated a few operators from binary-token-strings back to abbreviated names where the BTS gave no savings, so (I)$ is now fora (ie. forall). if du could be (T8)$, but if du is clearly a better choice (it's golf, not obfuscation per se). Also, perform the scale before translate, so translated coordinates can be 3 and 4 instead of 300 and 400.
(mat.ps)run 3(G)run $
t sin
A neg
t cos
0 0
0 1
1 0
2 mu Z 2(!V)@
idi 2 mo .5 su
(>8)$
[F D]
[D E]
[E D]
[D F]

3 4 100(&>88)$(,)# div(<N)#[E 15{[I 1 H I 2 H I 4 H ex 8 H]}fo]E
5{ARGUMENTS 1(XK/)$/t ex d{{J[0 C B 0][0 A C 0]K}{[C 0 A 0]L[B 0
C 0]K}{[C B D][A C D]M K}{[C D A]L M[B D C]}{J[0 C 0 B]M[0 A 0
C]}{J L[D C B][D A C]}}(>K)$[(>?)$]transpose matmul}fo
du(019;:89=?;37?>:26><804<=576451320){48 su get al po{W
Z Y X}{(>3)$}fora X G Y G{li}(D)#{mov}if du}fora(HB)#

The 3 4 and 100 in the first line of the second block are parameters representing center-x, center-y and scale, respectively, of the drawing on the page (center coordinates are scaled by scale). (300,400) is roughly the center of US letter-sized paper (612,792) in PS units.
If you can roughly follow postscript, the important bizarre things are the implicit procedure block and the encoded operator strings. As shown by comments in the workfile, below, each line of the first block is implicitly named by A, B, C, etc. So, eg. F E D would produce 1 0 0 1 0 0. For the encoded operator strings, anything that is an argument to $ # or @ is a sequence of operator calls, using the bytes to select operators from the system name table, PLRM 3ed Appendix F. These features and more are available for PostScript with the G library (now includes the mat.ps functions too).
Workfile:
(mat.ps)run 3(G)run $
t sin %/A
A neg %/B
t cos %/C
0 0 %/D
0 1 %/E
1 0 %/F
2 mu Z 2(!V)@ %/G  %ad div %add div %108 1 54
idi 2 mo .5 su %idiv mod sub %/H %106 169 51
(>8)$ %/I %exch dup
[F D] %/J
[D E] %/K
[E D] %/L
[D F] %/M

3 4
100(&>88)$ %currentlinewidth exch dup dup %38
(,)#  %scale %139-95=44
div(<N)# %div setlinewidth %54 155-95=60 %translate %173-95=78
%/V
[E 15{[ I
    1 H I
    2 H I
    4 H ex
    8 H]}fo]

E 5{ARGUMENTS 1(XK/)$ %index get cvr %88 75 47
    /t ex d %exch def %62 51
    {{J[0 C B 0][0 A C 0]K}
     {[C 0 A 0]L[B 0 C 0]K}
     {[C B D][A C D]M K}
     {[C D A]L M[B D C]}
     {J[0 C 0 B]M[0 A 0 C]}
     {J L[D C B][D A C]}}
    (>K)$ %exch get %62 75
    [
        (>?)$ %exch exec %62 63
    ]
    transpose matmul
}fo %for
du %dup
%d %def
%{transpose matmul}fora d

%[E 9 11 10 8 9 13 15 11 3 7 15 14 10 2 6 14 12 8 0 4 12 13 5 7 6 4 5 1 3 2 0]
%<0001090b0a08090d0f0b03070f0e0a02060e0c0800040c0d050706040501030200>
%          abcdef
%0123456789:;<=>?
(019;:89=?;37?>:26><804<=576451320)
{48 su get % 169 75 %V (>K)$ %sub %exch get

    al po %aload pop %2 117
    {W Z Y X}{(>3)$ %exch def
    }fora %forall %2 117  62 51 73
    X G
    Y G
    {li}(D)# %stopped
    {mov}
    if du%(T8)$ %if %84 du %dup 56
}
%<49a7a1>$ %forall stroke showpage %73 167-95=72 161-95=66
fora(HB)#

Ungolfed and lightly commented:
300 400 translate   %roughly center of letter paper
currentlinewidth
100 dup dup scale
div setlinewidth    %scale x100, reduce line-width/100
(mat.ps)run         %load matrix library
ARGUMENTS aload pop{f e d c b a}{exch cvr def}forall  %define args as
                                 % a,b,etc and convert to real numbers
/m{2 mod .5 sub}def
/P{aload pop{w z y x}{exch def}forall   %P: [x y z w]  project-and-draw  -
    x 2 mul z 2 add div
    y 2 mul z 2 add div
    {lineto}stopped{moveto}if %catch(&handle!) nocurrentpoint error in lineto
}bind def
/V[0 1 15{    % generate vectors with a for-loop
    [ exch
        dup m
        1 index 2 idiv m
        2 index 4 idiv m
        4 3 roll 8 idiv m
    ]
}for]
[[[1 0 0 0][0 a cos a sin neg 0][0 a sin a cos 0][0 0 0 1]]
     [[b cos 0 b sin 0][0 1 0 0][b sin neg 0 b cos 0][0 0 0 1]]
     [[c cos c sin neg 0 0][c sin c cos 0 0][0 0 1 0][0 0 0 1]]
     [[d cos 0 0 d sin][0 1 0 0][0 0 1 0][d sin neg 0 0 d cos]]
     [[1 0 0 0][0 e cos 0 e sin neg][0 0 1 0][0 e sin 0 e cos]]
     [[1 0 0 0][0 1 0 0][0 0 f cos f sin neg][0 0 f sin f cos]]]
{transpose matmul} forall def   % apply array of rotations and define

%Eulerian circuit (borrowed and adjusted for 0-based indexing)
[0 1 9 11 10 8 9 13 15 11 3 7 15 14 10 2 6 14 12 8 0 4 12 13 5 7 6 4 5 1 3 2 0]

% the main program!
% on the stack is the Eulerian circuit array
{
    V exch get  %lookup index in (sextuply-transformed) vertex array
    P           %call project-and-draw
} forall
closepath stroke %draw it, don't just think about it

showpage % gs's cmd-line-args option automatically sets -dBATCH,
    % so without a showpage, gs will immediately exit before you
    % can look at the picture :(

Some of my outputs are mirror images of the question's examples.
For gs -- hc.ps 0 0 0 0 0 0, I get:

gs -- hc.ps 0 0 0 0 0 30

gs -- hc.ps 30 0 0 0 0 30

gs -- hc.ps 0 0 0 30 30 30

gs -- hc.ps 45 45 45 0 0 0

gs -- hc.ps 45 45 45 45 45 45

Bonus animation I just made with this program.  This image corresponds to the rotation sequence 0 30 60 0 i i, where i ranges from 0 to 360 by 2.

Wow. A PostScript answer for a mathematical problem.

@TùxCräftîñg There's not actually that much math in this question as long as you can do matrix multiplication easily. And I've wanted to write this program ever since reading A. K. Dewdney's The Armchair Universe.

Added new functions to the G library. Can't use here, but it allows this 307 byte version.

C# + Unity, 1060 845 835 bytes
C# ≈ Java
Assumes that this function is in a script placed on MainCamera.
Edit:
Thanks to @TuukkaX for the suggestions to save 19 bytes
Saved ~200 bytes using the Eulerian cycle.
Golfed:
void d(float[]r){transform.position=Vector3.back*2;GetComponent<Camera>().backgroundColor=Color.black;Vector4[]p=new Vector4[16];Matrix4x4[]m=new Matrix4x4[6];int i=0;for(;i<16;i++)p[i]=new Vector4(i%2,i/2%2,i/4%2,i/8%2)-new Vector4(.5f,.5f,.5f,.5f);int[,]X={{6,8,1,12,7,11},{5,0,0,0,5,10},{10,10,5,15,15,15}};for(i=0;i<6;i++){m[i]=Matrix4x4.identity;r[i]=Mathf.Deg2Rad*r[i];float c=Mathf.Cos(r[i]),s=Mathf.Sin(r[i]);m[i][X[1,i]]=c;m[i][X[2,i]]=c;m[i][X[0,i]]=s;m[i][X[0,i]%4*4+X[0,i]/4]=-s;}for(i=0;i<16;i++)foreach(Matrix4x4 x in m)p[i]=x*p[i];int[]F={0,1,9,11,10,8,9,13,15,11,3,7,15,14,10,2,6,14,12,8,0,4,12,13,5,7,6,4,5,1,3,2,0};LineRenderer l=new GameObject().AddComponent<LineRenderer>();l.SetVertexCount(33);l.material=new Material(Shader.Find("Sprites/Default"));l.SetWidth(.03f,.03f);for(i=0;i<33;i++)l.SetPosition(i,p[F[i]]);

Newlines + indentation + Full shell:
using UnityEngine;
using System.Collections;

public class h : MonoBehaviour {

    void d(float[]r)
    {
        transform.position=Vector3.back*2.5f;
        GetComponent<Camera>().backgroundColor=Color.black;
        Vector4[]p=new Vector4[16];
        Matrix4x4[]m=new Matrix4x4[6];
        int i=0;
        for(;i<16;i++)p[i]=new Vector4(i%2,i/2%2,i/4%2,i/8%2)-new Vector4(.5f,.5f,.5f,.5f);
        int[,]X={{6,8,1,12,7,11},{5,0,0,0,5,10},{10,10,5,15,15,15}};
        for (i=0;i<6;i++){
            m[i]=Matrix4x4.identity;
            r[i]=Mathf.Deg2Rad*r[i];
            float c=Mathf.Cos(r[i]);
            float s=Mathf.Sin(r[i]);
            m[i][X[1,i]]=c;
            m[i][X[2,i]]=c;
            m[i][X[0,i]]=s;
            m[i][X[0,i]%4*4+X[0,i]/4]=-s;
        }
        for (i=0;i<16;i++)foreach(Matrix4x4 x in m)p[i]=x*p[i];
        int[]F={0,1,9,11,10,8,9,13,15,11,3,7,15,14,10,2,6,14,12,8,0,4,12,13,5,7,6,4,5,1,3,2,0};
        LineRenderer l=new GameObject().AddComponent<LineRenderer>();
        l.SetVertexCount(33);
        l.material=new Material(Shader.Find("Sprites/Default"));
        l.SetWidth(.03f,.03f);
        for (i=0;i<33;i++)
            l.SetPosition(i,p[F[i]]);
        l.gameObject.tag = "Player";
    }
    public float[] input;
    void Start()
    {
        d(input);
    }
}

I couldn't figure out a simple formula for constructing the rotation matrices nor the "faces" which to draw, so that cost a lot of bytes to hard-code. I borrowed the Eulerian cycle from @beaker. Also, Unity built-ins are extremely verbose.
You can verify all test cases online.

This is the first time I've seen a C# + Unity answer on here. +1

I think every 0.5f can be reduced to .5f and 0.01f to .01f. I also think that the integer arrays can be separated with a comma instead of saying int[] multiple times.

@Blue Oh, you're right! Haven't used C# for a while so wasn't sure of the last tip.

@TuukkaX Ignore my previous comment, I can use int[,]. Still, thank you.

You still have an Vector4(0.5f,0.5f,0.5f,0.5f) which could be reduced to Vector4(.5f,.5f,.5f,.5f).

Inside your second loop, float c=Mathf.Cos(r[i]);float s=Mathf.Sin(r[i]); could be reduced to float c=Mathf.Cos(r[i]),s=Mathf.Sin(r[i]);.

Javascript ES6, 584 bytes
f=(...R)=>(P=s=>[...s].map(i=>parseInt(i,16)),C=document.createElement`canvas`,X=C.getContext`2d`,X.translate((C.width=300)/2,(C.height=300)/2),X.lineWidth=0.01,X.scale(100,100),X.beginPath(),P("0267fd9804c8ab915dcefb37546ea2310").map((e,i)=>{[x,y,z]=P("084c2a6e195d3b7f").map(i=>[...(1e3+i.toString(2)).slice(-4)].map(i=>i-0.5)).map(e=>(R.map((R,i,_,M=Math,C=M.cos(r=R*M.PI/180),S=M.sin(r))=>((a,b,s=1)=>[e[a],e[b]]=[C*e[a]-s*S*e[b],s*S*e[a]+C*e[b]])(...[[1,2],[0,2,-1],[0,1],[0,3,-1],[1,3],[2,3]][i])),e))[e];[x,y]=[2*x/(2+z),2*y/(2+z)];i?X.lineTo(x,y):X.moveTo(x,y)}),X.stroke(),C)

"Ungolfed":
f=(...R)=>(                                                              // function that accepts rotations in the following form: f(a,b,c,d,e,f)
    P=s=>[...s].map(i=>parseInt(i,16)),                                  // function to convert strings to hex-arrays
    V=P("084c2a6e195d3b7f")                                              // vertices encoded as hex values ( [0,1,1,0] -> 6 )
        .map(i=>[...(1e3+i.toString(2)).slice(-4)].map(i=>i-0.5))        // convert hex values to vertices, center the hypercube
        .map(e=>(R.map((R,i,_,M=Math,C=M.cos(r=R*M.PI/180),S=M.sin(r))=> // convert angles to degrees, precalculate sin and cos values
        ((a,b,s=1)=>[e[a],e[b]]=[C*e[a]-s*S*e[b],s*S*e[a]+C*e[b]])       // apply matrix transforms to all vertices
        (...[[1,2],[0,2,-1],[0,1],[0,3,-1],[1,3],[2,3]][i])),e)),        // list of encoded matrix transforms
    C=document.createElement`canvas`,X=C.getContext`2d`,                 // create image to draw on
    X.translate((C.width=300)/2,(C.height=300)/2),                       // setup image dimensions, center transform
    X.lineWidth=0.01,X.scale(100,100),X.beginPath(),                     // setup line, scale the transform and begin drawing
    P("0267fd9804c8ab915dcefb37546ea2310").map((e,i)=>{                  // hypercube edge path indices encoded as hex values
        [x,y,z]=V[e];[x,y]=[2*x/(2+z),2*y/(2+z)];                        // project vertex
        i?X.lineTo(x,y):X.moveTo(x,y)}),X.stroke(),                      // draw vertex
    C)                                                                   // return image

See it in action (modified to continuously rotate):

with(document)with(Math)with(document.getElementById`canvas`)with(getContext`2d`){render=()=>{requestAnimationFrame(render);clearRect(0,0,width,height);save();K=performance.now();R=[K*0.01,K*0.02,K*0.03,K*0.04,K*0.05,K*0.06];X=s=>[...s].map(i=>parseInt(i,16));V=X("084c2a6e195d3b7f").map(i=>[...(1e3+i.toString(2)).slice(-4)].map(i=>i-0.5)).map(e=>(R.map((R,i,_,C=cos(r=R*PI/180),S=sin(r))=>((a,b,s=1)=>[e[a],e[b]]=[C*e[a]-s*S*e[b],s*S*e[a]+C*e[b]])(...[[1,2],[0,2,-1],[0,1],[0,3,-1],[1,3],[2,3]][i])),e));translate((width=300)/2,(height=300)/2);lineWidth=0.01;scale(100,100);beginPath();X("0267fd9804c8ab915dcefb37546ea2310").map((e,i)=>{[x,y,z]=V[e];[x,y]=[2*x/(2+z),2*y/(2+z)];i?lineTo(x,y):moveTo(x,y)});stroke();restore();};render();}
<canvas id="canvas"></canvas>

The function returns a HTML5 canvas object, you need to add it to the page by doing document.body.appendChild(f(0,0,0,0,0,0)) for example.
Currently, the rotations are applied out of order, I'm working on the reordering, but as is, it rotates a hypercube correctly.

Clever, it took me a while to figure out what you were doing with the matrix transforms. :D Also, I can't get your code snippet to work... it's giving me an unhelpful "Script error." in line 0.

@beaker What browser are you using? I've tested it on the latest Firefox.

I'm on Safari 9.1.1. Let me try a different one.

Yep, Chrome works just fine.

Safari is crap. Don't use it to check if something works.

Mathematica, 453 415 bytes*
Shortened by using the Eulerian tour and cleaning it all up into a single statement without defining functions in variables. This makes the code slower for some reason. I'm guessing Mathematica reevaluates the functions multiple times now that they are not stored in a variable.
Graphics[Line[Table[{2#/(2+#3),2#2/(2+#3)}&@@Map[Dot@@Table[Table[If[n==m==#2||n==m==#,Cos[#3],If[n==#2&&m==#,If[#2==1&&(#==3||#==4),1,-1]Sin[#3],If[n==#&&m==#2,If[#2==1&&(#==3||#==4),-1,1]Sin[#3],If[n==m,1,0]]]],{n,4},{m,4}]&[k[[1]],k[[2]],a[[k[[3]]]]°],{k,{{4,3,6},{4,2,5},{4,1,4},{2,1,3},{3,1,2},{3,2,1}}}].#&,Tuples[{0,1},4]-.5,{1}][[i]],{i,{1,2,10,12,11,9,10,14,16,12,4,8,16,15,11,3,7,15,13,9,1,5,13,14,6,8,7,5,6,2,4,3,1}}]]]

* I am counting ° and == as single bytes each since they are represented as  a single character in Mathematica. I think this is fair since lots of languages use weird character encodings.
Ungolfed with comments. The input is hard coded at the top as a={30,0,0,0,0,30};. I didn't count that toward my score.

a = {45, 45, 45, 45, 45, 45};

(* #2,#-th rotation matrix as a funciton of #3 *)
(* Using the \
#-notation saved 6 bytes over the more common function definition \
notation*)
r =
  Table[If[n == m == #2 || n == m == #, Cos[#3],
     If[n == #2 && m == #,
      If[#2 == 1 && (# == 3 || # == 4), 1, -1] Sin[#3],
      If[n == # && m == #2,
       If[#2 == 1 && (# == 3 || # == 4), -1, 1] Sin[#3],
       If[n == m, 1, 0]]]], {n, 4}, {m, 4}] &;

(* Total rotation matrix. Need six of them. Function of the six \
angles to rotate.*)

u = Dot @@
     Table[r[k[[1]],
       k[[2]], \[Degree]*
        a[[k[[3]]]]], {k, {{4, 3, 6}, {4, 2, 5}, {4, 1, 4}, {2, 1,
         3}, {3, 1, 2}, {3, 2, 1}}}].# &;

(* List of all vertices of the hypercube *)
t = Tuples[{0, 1}, 4];
t -= .5;
v = Map[u, t, {1}];

(*projection*)
p = {2 #/(2 + #3), 2 #2/(2 + #3)} &;

(*Eulerian tour*)

l = Table[
   p @@ v[[i]], {i, {1, 2, 10, 12, 11, 9, 10, 14, 16, 12, 4, 8, 16,
     15, 11, 3, 7, 15, 13, 9, 1, 5, 13, 14, 6, 8, 7, 5, 6, 2, 4, 3,
     1}}];
Graphics[Line[l]]

0 0 0 0 0 30

0 0 0 30 30 30

405 10 -14 -8 -9 205