@function diagonal-length($points...) {
	$unit: unit(nth($points, 1));

	$x0: 0;
	$x1: 0;
	$y0: 0;
	$y1: 0;

	@if length($points) > 1 {
		@if length($points) == 2 {
			$x0: nth($points, 1);
			$x1: nth($points, 1);
			$y0: nth($points, 2);
			$y1: nth($points, 2);
		} @else if length($points) == 3 or length($points) > 4 {
			@warn 'Give either 1,2 or 4 values.';
			@return null;
		} @else if length($points) == 4 {
			$x0: nth($points, 1);
			$x1: nth($points, 2);
			$y0: nth($points, 3);
			$y1: nth($points, 4);
		}
	} @else {
		$x1: nth($points, 1);
		$y1: nth($points, 1);
	}

	$x: strip-unit($x1) - strip-unit($x0);
	$y: strip-unit($y1) - strip-unit($y0);

	$diagonal: sqrt($x * $x + $y * $y);
	@return unquote(#{$diagonal}#{$unit});
}
