Author's Note: This is for all those who prefer a graphing calculator to an iPod. Let me know if you like it! Or even if you don't.

Valley of the Shadow

They stepped out of the Stargate and into an ambush.

It was a moist jungle region of the planet; lush vegetation clung to the sides of the ravine they had just entered. To the right of the Stargate rose a sheer hundred-meter wall, festooned with fragile orchids dangling their bright flowers in the air. Exotic ferns seemed to grow on the air itself, their light green leaping out in contrast to the shadowed wall. The other side of the ravine showed a gentler slope populated with trees, vines, and crumbling rocks. The jungle steamed as the sun tossed down the scorching rays that made the rim of the Stargate sparkle.

The beauty of the region and the heat struck the travelers instantly as they stepped through the gate.

So did the sense of impending danger.

Teal'c saw it first; they had barely been there five minutes, and were clambering up the left side with Daniel hot in pursuit of Ancient relics. From the moment Teal'c had arrived, there had been a small thought at the back of his mind, telling him that something was not right. He stopped to look around. Daniel was making his way steadily up the incline, with Cameron right behind him. Teal'c looked to the opposite side of the ravine; he saw nothing unusual. Then he looked up, up to the canyon rim, barely visible because of the blazing sun. Something moved, and then flashed. Teal'c barely had time to shout a warning before the jungle was soaked with enemy fire.

Uninhabited planet? Tell me about it, Cameron said to himself as he fired at - well, the enemy, presumably.

Unfortunately, he couldn't actually see any of them; he had no idea who was firing at his team and why. The same jungle that was providing him with cover was drastically obscuring his view. Not that it kept him from shooting back at wherever the weaponsfire had come from. He dodged a shot that had come uncomfortably close to his head. And he'd thought this mission would be boring.

He really should've known better; he'd read enough of SG-1's mission reports to know that standard assignments could easily turn catastrophic. But the MALP and aerial scans hadn't shown any signs of sentient life, and had provided some evidence to confirm the reports of a possibly Ancient lab. Those scans should have been able to detect a force of this size.

The enemy was well positioned and well armed, it seemed. Most of their light-blue bolts were coming from the opposite side of the ravine; Cameron and his team had to look into the sun and fire uphill at targets concealed in the jungle - and they could only guess where those targets actually were. To shoot from their position, all the enemy would have to do was look down, find a target, and shoot. It would only be a matter of time before they hit someone. And if they got impatient and had enough firepower, they could easily set the jungle – and everyone in it – alight. Neither of these possibilities was particularly appealing to Cameron.

SG-1 was outmanned and outgunned. And the enemy had the high ground. Cameron knew a desperate situation when he saw one, and unless something miraculous happened, SG-1 was either going to end up dead or captured. The enemy seemed to prefer dead; and Carter, the resident miracle-worker, was back at the SGC with a sprained ankle.

Cameron dove behind a boulder as a shower of staff blasts burned a hole through the large tree he'd been standing by a second earlier.

Yeah, he thought as he glanced up. We could use a miracle about now.

Daniel hated firefights. He was especially starting to dislike this one. He wasn't a military man, but he'd seen enough combat to know that in an encounter like this, someone was going to end up hurt.

Or dead.

At least Teal'c had been able to give them a warning. If he hadn't...

Daniel shuddered as he remembered the blast that had found the hillside just above his head as he'd ducked. He shuddered again as he leapt aside to avoid a similar shot, missed his footing coming down, and went sprawling down the slope. Five seconds later he slammed into a mossy sandstone rock. He silently cursed the pain as he extricated his arm from the underbrush.

At least he'd had the presence of mind to hold on to his weapon, and the rock had kept him from rolling all the way into the open. He checked his arms and legs. Nothing was broken, which was good news. Daniel took up a position behind the boulder and started shooting.

Wait a minute, his archaeologist's mind thought. What's a sandstone doing in a tropical jungle? He stopped firing for a second and looked at the rock again. He squinted, and ran his finger over the faint carvings, trying to make out the words. The writing was in Ancient!

They'd come in search of an Ancient laboratory; their chances of actually finding it weren't very high, but they were high enough for Carter to wish she could come along.

"But there's really not much good you can do us if you can't even walk," he'd told her at the briefing. She'd been working hard to convince General Landry that she needed to go.

"You're not going, Carter, and that's an order. My order, and the doctor's orders," Landry had told her.

She'd sighed, picked up her crutches and started out of the room with the rest of SG-1. "Don't touch anything!" she warned. "You don't know what might be out there, and I want everything intact when I get there!"

Cameron moved to help her negotiate the stairs down to the control room. "At your present rate, that'll take about a month," he said.

Sam glared at him. "Don't touch anything. Especially you."

"What do you mean, especially me?"

"You know what happened last time, and I just don't want my lab messed up. Daniel –"

"I was not aware that the laboratory was already in your possession, Colonel Carter."

Sam ignored Teal'c. "Daniel, if you find anything, make sure you read it carefully, and get everything on digital video for me, highest resolution possible, and I'll need the translations of course –"

"Yes, ma'am," Daniel sighed, and considered throwing her a mock salute. Sam hadn't been so bad in years. But he could almost understand why. "You just want to go play, don't you?"

She'd blushed. "No, no, a find like this could mean – well, imagine what this would do for our technology level–"

Cameron had laughed. "Don't worry, Sam, we'll find you some new toys."

She hadn't dignified that with a response.

Daniel squinted again at the faded writing, excitement growing as he deciphered it. It was a map, he decided, or a marker stone of some sort. If only people would stop shooting at him, he could find out what it led to; Daniel was sure it would be a big find, the tablet said it was a key of some sort…

As his hand moved to his radio, Daniel looked up.

That glance saved his life. Daniel scrambled sideways just in time to avoid being blown to bits.

The rock, however, hadn't shared his good fortune. Daniel stared sadly at the remnants of the sandstone boulder. Another priceless archaeological find destroyed by war.


Teal'c had gone farther up the slope than the others, trying to discover who or what was firing at them. He had reached a small plateau, populated with a few thin trees and lots of underbrush and insects, when he heard Cameron's voice on the radio, calling for them to regroup. Teal'c suggested his location; for some reason, there was something about it that alerted his warrior's senses. Their situation was dire, but maybe there was a way out of this trap after all...

There was a pinnacle above the ravine wall, and a small, unnaturally lighted part of it caught Teal'c's eye. Teal'c couldn't figure out what it was. It was not artificial light, and it only illuminated more jungle. But somehow it triggered his instincts and he knew that in some hidden way it was a key to their survival.

But how? he asked himself.

He could think of no answer.

Then Cameron arrived, breathing heavily and limping slightly. He leaned on a small tree for support, the sun projecting his shadow onto the ground in front of Teal'c. Teal'c shifted his staff weapon and aimed for the edge of the ravine, then stopped.

A series of images suddenly flashed through his mind.

The pinnacle. The sun. The glint he'd seen that had first alerted him to danger. The level ground. Colonel Mitchell and his shadow. The staff weapon. A way of escape…

"Colonel Mitchell, stand still." Teal'c reached into one of his pockets and took something out.

He started to work.

Daniel crashed through the thick foliage, headed, he hoped, to where Teal'c and Cameron would be. He winced as he tripped over a hidden root. The collision with the artifact had left him sore, and not just because he'd been deprived of a discovery. Looking ahead, he could see where the trees thinned a little and the ground leveled. Was this the place Teal'c had mentioned?

Daniel stumbled forward, and let out a sigh of relief when he broke through to the slight clearing.

Then he drew in his breath sharply when he saw Teal'c, his staff weapon raised towards Cameron, who was standing stiffly, eyeing the weapon in disbelief.

Daniel stepped backward, trying to collect his whirling thoughts. What was going on?

Then he saw a small device in Teal'c's hand, and leaned forward for a better look. A small smile started across his mouth as he thought with amusement,

Cameron straightened and stared at Teal'c. His eyes fastened first on the raised staff weapon. He blinked, puzzled. Teal'c wasn't going to shoot him, he knew, but what was he going to do? The Jaffa wore a look of intense concentration, but Cameron couldn't imagine what he was focusing on.

Cameron studied Teal'c's face, and in the corner of his eye glimpsed Daniel coming up behind Teal'c.


Cameron's eyes traveled down to the thing Teal'c was holding. It looked terribly familiar, but he couldn't place it.

Suddenly understanding dawned, and he had to try hard to hold back a smile. "Is that a calculator?" he asked.

"Indeed it is," replied Teal'c, in a tone Cameron interpreted to mean, Of course, you idiot.

At that, he had to grin.

Teal'c had always liked mathematics, even as a small child. Unfortunately, the Goa'uld had a very rough educational system, and even a willing student could find it hard to obtain support for his academic goals. So when Tea'lc had come to Earth, he'd been amazed at the complex mathematics the Tau'ri used. He had resolved to study them in his spare time.

But because his line of work was saving the world, Teal'c did not have much spare time.

It was only recently that he'd been able to pursue his hobby. He'd spent his first five years at the SGC finding out everything about Tau'ri military capabilities and tactics in his free time. Then he had studied all the information available on alien military science. Only after this did he feel able to take time for math.

It was Sam Carter who had taught him most of what he knew, though he had started with textbooks bought from local universities. Sam had never mentioned the lessons to anyone; Teal'c suspected that this was because she simply assumed that everyone was as interested as she was in higher mathematics. Still, he was glad that O'Neill had never heard about this particular pastime of his.

Teal'c's favorite subjects were trigonometry and multivariable calculus. At the end of a long day, he liked to take out his giant book of math puzzles and solve a few problems. He liked the way he could manipulate the numbers, how a pattern eventually emerged and made everything seem so simple. It was nice to know that every problem had a solution.

And whenever Teal'c came to a tough spot, he had his calculator to help him.

It was a special calculator; it had been Carter's before she had swapped it for a miniaturized computer. It was full of programs she had written for almost every situation imaginable. Teal'c remembered seeing her use it on innumerable occasions on other worlds, to help her with whatever scientific activity she happened to be engaged in.

And now Teal'c was using it for a different purpose, to solve a different kind of problem. If the numbers worked out, they would live.

If not, they would die.

Cameron was trying hard to reconcile Teal'c and math. But somehow it was difficult to picture Teal'c, a pencil behind his ear, sitting at a desk piled with scrap paper covered with scribblings. Cameron knew a lot of people with hobbies that seemed incompatible with their jobs - he himself was a bit of a musician - but Teal'c and math?

Cameron knew it was no laughing matter; when he looked at Teal'c, he could sense the intensity with which he worked. Teal'c was working on a solution to their problem, a problem that Cameron could clearly see in front of them. They were standing opposite an enemy horde, separated only by a small canyon and a few scrawny trees. At most, it would be two or three minutes before the enemy discovered them. The only chance they had was in the cold, impersonal world of mathematics.

The numbers didn't care what happened to them.

A bead of sweat rolled down Teal'c's face. He forced himself to ignore the sounds of weaponsfire and concentrate.

The light. It was a reflection off of a metal surface. The glint he had seen told him that it came from some sort of building. He had to find out exactly where it was.

Teal'c looked at his watch. Like all of SG-1's watches, it was far from ordinary. Sam Carter had modified it so that it automatically computed the local time and date, as well as a number of other useful things, such as oxygen content of the air, air pressure, and the local gravitational acceleration. Right now, Teal'c only needed the time.

It was three hours forty-seven minutes after local noon. From his knowledge of astronomy and trigonometry Teal'c calculated the sun's declination. So far, so good.

Judging from the way the sun was shining, the reflection could only have come off of a slanted surface - like a roof. Now he needed to know exactly how high up on the pinnacle it was. Teal'c knew how high the sun was in the sky, and he knew Cameron Mitchell's height to the centimeter. Taking his current position to be at the height of zero, Teal'c used similar triangles to find the reflection's height. A little more manipulation gave him the Cartesian coordinates of the object the light had reflected off of.

He stared at his calculator. According to the numbers, the object was four and a half meters from the edge of the ravine. But that couldn't be right; Teal'c was certain that he had seen something on the edge of the ravine.

Taking a few precious seconds, Teal'c considered. He knew he hadn't made any mistakes. There had to be something he was overlooking.

Daniel watched his friend anxiously. It was a little odd, actually; he was used to staring over Sam Carter's shoulder, eyes glued to her computer screen as she rushed to complete a program in time. Now he was watching Teal'c, again not understanding exactly what was going on, but desperately wishing that there was something he could do to help.

At the same time, Daniel was keeping an anxious eye on the weaponsfire. There had already been several near misses, and he feared that it wouldn't be long before the blasts found their marks. He crouched down, taking a defensive position near Teal'c as he watched the Jaffa's face and breathed a silent prayer.

Teal'c closed his eyes, trying to think clearly. He shoved down the part of himself that was berating him for wasting precious time.


The pinnacle. The reflection. The glint. Four and a half meters.


He felt a rush of uncertainty; this was something totally out of his area of expertise. Sam should be here to do this. She knew more about this than he ever would, and she wouldn't make mistakes. Teal'c was confident in his abilities as a warrior, but he was just an amateur mathematician. For a moment he experienced what it was like to be Carter, and he felt a rush of sympathy for her. He'd never really understood what it was like before, to rely on the distant scientific world for answers to life-threatening emergencies. To be in a situation where there was nothing he could do, where if the laws of science said they must die, they would die, and there was nothing he could do about it, nothing at all…

Teal'c sucked in a deep breath, trying to quell the unfamiliar feelings. A part of him wanted to cry out in anger and frustration; he pushed it down, and instead it came out as a tiny plea in the back of his mind, asking for someone, anyone, to help.

He exhaled slowly, trying to clear his mind. Instead all he could think of was an something he had read once, in one of Daniel's books on Earth: Yea, though I walk through the valley of the shadow of death, I shall fear no evil, for Thou art with me. Thy rod and Thy staff, they comfort me...

Of all the times to think of ancient history! He'd been around Daniel too much.

And then Teal'c saw it.

Valley. Shadow. Rod and staff...

He could have laughed; it was so obvious. The sun was positioned so that the right side of the valley had been in shadow when they had come through the Stargate. Looking up, Teal'c had only been able see the glint because came from something projecting slightly over the canyon rim, enabling it to catch the sun. Climbing up the angled left side while looking at the still-shaded right side, Teal'c had failed to see all the similar projections like it.

There were no people shooting at them; the blasts originated from an automated system, most likely controlled by the building that had reflected the sun's light onto the pinnacle. It had probably been built a long time ago – maybe even by the Ancients, to protect whatever was on the planet. Since then, the weapons on the left side of the gorge had been buried under rock and earth slides. When SG-1 had left the vicinity of the Stargate, they must have alerted the system.

Now, how to destroy it?

Teal'c took up his calculator again. He called up a program for projectile targeting and started entering values for wind speed and direction, altitude, gravitational acceleration, and the location of the target. The program would tell him at what angle he should aim his weapon. Now Teal'c only needed one more thing.

Teal'c's staff weapon had been specially modified only the week before. He had wanted a way to carry a portable rocket launcher as well as his other weapons. Carter had looked at his staff, done a little work, and given it back to him. One end was now a customized rocket launcher. But it only had one missile.

He knew exactly how much force the rocket was launched with. He keyed the number into the calculator.

In less than a second, Teal'c would know whether or not his work had been in vain. He knew the odds; it would be a miracle if all the numbers worked out.

A single number appeared on the calculator screen. Teal'c's heart leapt when he saw it.

It was a real angle.

And it was between zero and ninety degrees.


Teal'c quickly lined up the angle, this time using the length of his staff and of Mitchell's shadow to find the right one.

The weaponsfire was raining down with a vengeance now; the system had found them. Out of the corner of his eye, Teal'c saw Daniel and Cameron duck for cover as the blasts closed in. Daniel was shouting something, but Teal'c didn't hear a word.

Teal'c's whole world was concentrated around his staff weapon. A sudden breath of wind brushed through the trees; Teal'c ground his teeth in impatience while he waited for it to die down. Vaguely he was aware of the shouts from Daniel and Cameron, telling him to take cover. He could feel the blasts impacting the trees and ground around him; he saw that the plateau was turning into a veritable hell, he saw Cameron Mitchell fall to the ground, he felt a scorching heat graze his shoulder.

Teal'c kept his staff steady, and waited.

The wind died down.

Then he fired.

"So, does this mean that I'll have to call you "Dr. Teal'c" from now on?" Cameron asked as SG-1 left their mission debriefing.

The corner of Teal'c's mouth lifted in a slight smile as he replied, "Indeed."

Sam laughed. Teal'c was one of the humblest people she knew, but she had heard the pride in his voice at the compliment. Teal'c was her favorite student, her protégé, and she was incredibly proud of him. "Who would've ever thought that our little after-hours lessons would lead to this?"

She turned to Teal'c. "When you told me how you did it, I wouldn't have believed you if I hadn't taught you myself."

"And why is that, Colonel Carter?" Teal'c asked.

"Sam, I think you just insulted his intelligence, " Daniel said, smirking.

"Daniel!" Sam glared reproachfully at the archaeologist, then considered. Maybe that hadn't come out exactly right. "You know I don't mean it like that, Teal'c – don't you?"

"I understand, Colonel Carter."

"The setup of the problem was excellent, and the way you immediately identified the variables was great. I wouldn't even have known how much force it took to launch that rocket, especially to the third decimal place! And then the whole situation - and the way everything came out exactly right - that's just a one-in-a-billion chance!"

"Well, if you want to talk about probabilities, what were the chances that the thing that hit Cameron just grazed him enough to knock him out but didn't kill him?" Daniel asked. "I suppose you could attribute it to dumb luck, but..."

Cameron shot him a look, but it was softer than usual because he was glad to be alive.

"Well," Daniel conceded, "I guess luck really had nothing to do with it."

"I believe you are correct, Daniel Jackson."

They continued down the hallway together in thoughtful silence.

Teal'c followed Daniel down the passage to his lab. "Daniel Jackson, while I was performing the calculations, I recalled a segment from one of your books which helped me considerably."

"Yeah, that happens to me a lot. I'll be in the middle of something really important, like trying to stay alive, and all I can think of is old sayings and strange inscriptions... " Daniel looked up at his friend's face.

There was a brief pause. "Sorry. So, what was it?" Daniel prompted.

"It was certainly was fitting to our situation." Teal'c's voice grew deeper as he quoted, "Yea, though I walk through the valley of the shadow of death -"

"The twenty-third Psalm," Daniel interrupted. Then he stopped to consider. "Valley of the shadow... you're right. Interesting..."

"Are you familiar with the rest of the saying?" Teal'c asked.

"It's not a saying, it's a Psalm, a hymn of praise," Daniel explained. "Let's see...

'Yea, though I walk through the valley of the shadow of death, I shall fear no evil, for Thou art with me. Thy rod and Thy staff, they comfort me. Thou preparest a table for me in the presence of my enemies; my cup runneth over. Surely goodness and mercy will follow me all the days of my life, and I shall dwell in the house of the Lord forever.'"

Teal'c bowed his head.

Cameron slowed his pace to stay with Sam as they headed towards the elevator.

After a while, Sam spoke. "Cam..."


"Do you go back to the Academy anymore?" she asked.


Two nurses hurried past, and disappeared around a bend.

"There's some special places there."

Cam nodded. "The chapel."


They turned a corner.

"Every once in a while, I like to go back there..."

Cameron understood. He finished her sentence for her. "To say thanks."